gradle-plugins/gradle/compile/java.gradle

35 lines
684 B
Groovy
Raw Normal View History

2021-11-09 14:08:25 +01:00
apply plugin: 'java-library'
java {
modularity.inferModulePath.set(true)
2023-05-21 13:16:00 +02:00
withSourcesJar()
2023-05-24 22:42:39 +02:00
withJavadocJar()
2021-11-09 14:08:25 +01:00
}
compileJava {
2023-05-16 14:01:42 +02:00
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
2021-11-09 14:08:25 +01:00
}
compileTestJava {
2023-05-16 14:01:42 +02:00
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
2021-11-09 14:08:25 +01:00
}
jar {
manifest {
attributes('Implementation-Version': project.version)
}
}
tasks.withType(JavaCompile) {
options.compilerArgs.add('-Xlint:all,-fallthrough')
2022-11-10 10:00:21 +01:00
options.encoding = 'UTF-8'
2021-11-09 14:08:25 +01:00
}
2022-11-10 10:00:21 +01:00
tasks.withType(Javadoc) {
2021-11-09 14:08:25 +01:00
options.addStringOption('Xdoclint:none', '-quiet')
2022-11-10 10:00:21 +01:00
options.encoding = 'UTF-8'
2021-11-09 14:08:25 +01:00
}