datastructures/gradle/compile/java.gradle

49 lines
945 B
Groovy
Raw Permalink Normal View History

2020-09-12 22:42:03 +02:00
apply plugin: 'java-library'
java {
modularity.inferModulePath.set(true)
}
compileJava {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
2020-09-12 22:42:03 +02:00
}
compileTestJava {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
2020-09-12 22:42:03 +02:00
}
jar {
manifest {
attributes('Implementation-Version': project.version)
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
2021-12-21 22:15:20 +01:00
dependsOn classes
2020-09-12 22:42:03 +02:00
classifier 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
2021-12-21 22:15:20 +01:00
dependsOn javadoc
2020-09-12 22:42:03 +02:00
classifier 'javadoc'
2021-07-14 11:18:11 +02:00
from javadoc.destinationDir
2020-09-12 22:42:03 +02:00
}
artifacts {
archives sourcesJar, javadocJar
}
2021-04-08 22:36:40 +02:00
tasks.withType(JavaCompile) {
options.compilerArgs.add('-Xlint:all')
options.encoding = 'UTF-8'
2021-04-08 22:36:40 +02:00
}
2020-09-12 22:42:03 +02:00
tasks.withType(Javadoc) {
2020-09-12 22:42:03 +02:00
options.addStringOption('Xdoclint:none', '-quiet')
options.encoding = 'UTF-8'
2020-09-12 22:42:03 +02:00
}