139 lines
3.2 KiB
Groovy
139 lines
3.2 KiB
Groovy
buildscript {
|
|
def config = new Properties()
|
|
file('build.properties').withInputStream(config.&load)
|
|
project.ext.config = config
|
|
}
|
|
|
|
apply plugin: 'java'
|
|
apply plugin: 'eclipse'
|
|
apply plugin: 'maven'
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
google()
|
|
|
|
maven {
|
|
url = "https://maven.speiger.com/repository/main"
|
|
}
|
|
}
|
|
|
|
archivesBaseName = config.project_name
|
|
version = config.project_version
|
|
group = config.project_group
|
|
sourceCompatibility = config.java_source_version
|
|
targetCompatibility = config.java_target_version
|
|
|
|
javadoc {
|
|
options.tags = [ "implSpec", "note" ]
|
|
failOnError = false
|
|
options.memberLevel = JavadocMemberLevel.PUBLIC
|
|
options.quiet()
|
|
}
|
|
|
|
eclipse {
|
|
classpath {
|
|
downloadJavadoc = true
|
|
downloadSources = true
|
|
|
|
file {
|
|
whenMerged {
|
|
//Enforce a custom container and allowing access to the sun.misc package which is nessesary for EnumMaps
|
|
entries.find{ it.kind == 'con' && it.path.startsWith('org.eclipse.jdt')}.path = 'org.eclipse.jdt.launching.JRE_CONTAINER';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType(JavaCompile) {
|
|
sourceCompatibility = config.java_source_version
|
|
targetCompatibility = config.java_target_version
|
|
options.encoding = 'UTF-8'
|
|
}
|
|
|
|
compileJava {
|
|
options.compilerArgs << '-XDignore.symbol.file'
|
|
options.fork = true
|
|
options.forkOptions.executable = 'javac' // may not needed on 1.8
|
|
}
|
|
|
|
sourceSets {
|
|
builder
|
|
}
|
|
|
|
configurations {
|
|
builderCompile.extendsFrom compile
|
|
}
|
|
|
|
dependencies {
|
|
implementation group: 'org.jetbrains', name: 'annotations', version: config.annotations_version
|
|
|
|
builderCompile group: 'de.speiger', name: 'Simple-Code-Generator', version: config.scg_version
|
|
runtimeOnly group: 'de.speiger', name: 'Simple-Code-Generator', version: config.scg_version
|
|
|
|
testImplementation 'junit:junit:4.12'
|
|
}
|
|
|
|
task generateSource(type: JavaExec) {
|
|
group = 'internal'
|
|
description = 'Builds the sourcecode'
|
|
classpath = sourceSets.builder.runtimeClasspath
|
|
main = 'speiger.src.builder.PrimitiveCollectionsBuilder'
|
|
}
|
|
|
|
task forceGenerateSource(type: JavaExec) {
|
|
group = 'internal'
|
|
description = 'Builds the sourcecode forceful'
|
|
classpath = sourceSets.builder.runtimeClasspath
|
|
main = 'speiger.src.builder.PrimitiveCollectionsBuilder'
|
|
args = ['true']
|
|
}
|
|
|
|
task javadocJar(type: Jar) {
|
|
from javadoc
|
|
classifier = 'javadoc'
|
|
}
|
|
|
|
task srcJar(type: Jar) {
|
|
from sourceSets.main.allSource
|
|
classifier = 'sources'
|
|
}
|
|
|
|
artifacts {
|
|
archives javadocJar
|
|
archives srcJar
|
|
}
|
|
|
|
test {
|
|
useJUnit()
|
|
}
|
|
|
|
uploadArchives {
|
|
repositories.mavenDeployer {
|
|
repository(url: 'https://maven.speiger.com/repository/main') {
|
|
authentication(userName: project.properties.mavenUser, password: project.properties.mavenPassword)
|
|
}
|
|
snapshotRepository(url: 'https://maven.speiger.com/repository/main') {
|
|
authentication(userName: project.properties.mavenUser, password: project.properties.mavenPassword)
|
|
}
|
|
pom {
|
|
version = project.version
|
|
artifactId = config.artifact_id
|
|
groupId = config.artifact_group
|
|
project {
|
|
licenses {
|
|
license {
|
|
name = 'The Apache License, Version 2.0'
|
|
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
|
}
|
|
}
|
|
developers {
|
|
developer {
|
|
id = 'speiger'
|
|
name = 'Speiger'
|
|
email = 'speiger@gmx.net'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |