guava/gradle/compile/java.gradle

31 lines
692 B
Groovy
Raw Normal View History

2021-03-07 20:44:20 +01:00
apply plugin: 'java-library'
java {
2025-01-01 13:43:06 +01:00
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
2021-03-07 20:44:20 +01:00
modularity.inferModulePath.set(true)
2023-05-25 16:30:30 +02:00
withSourcesJar()
2025-01-01 13:43:06 +01:00
withJavadocJar()
2021-03-07 20:44:20 +01:00
}
jar {
manifest {
attributes('Implementation-Version': project.version)
}
}
2021-03-18 22:19:14 +01:00
tasks.withType(JavaCompile) {
2025-01-01 13:43:06 +01:00
options.fork = true
options.forkOptions.jvmArgs += ['-Duser.language=en','-Duser.country=US']
options.compilerArgs.add('-Xlint:-requires-transitive-automatic')
options.compilerArgs.add('-Xlint:deprecation')
options.encoding = 'UTF-8'
2021-03-18 22:19:14 +01:00
}
tasks.withType(Javadoc) {
2021-03-18 22:19:14 +01:00
options.addStringOption('Xdoclint:none', '-quiet')
options.encoding = 'UTF-8'
2021-03-18 22:19:14 +01:00
}