files/gradle/compile/java.gradle

35 lines
680 B
Groovy
Raw Normal View History

2021-11-29 15:44:33 +01:00
apply plugin: 'java-library'
java {
modularity.inferModulePath.set(true)
2023-05-24 21:08:11 +02:00
withSourcesJar()
withJavadocJar()
2021-11-29 15:44:33 +01:00
}
compileJava {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
2021-11-29 15:44:33 +01:00
}
compileTestJava {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
2021-11-29 15:44:33 +01:00
}
jar {
manifest {
attributes('Implementation-Version': project.version)
}
}
tasks.withType(JavaCompile) {
options.compilerArgs.add('-Xlint:all,-exports')
options.encoding = 'UTF-8'
2021-11-29 15:44:33 +01:00
}
tasks.withType(Javadoc) {
2021-11-29 15:44:33 +01:00
options.addStringOption('Xdoclint:none', '-quiet')
options.encoding = 'UTF-8'
2021-11-29 15:44:33 +01:00
}