net-http/gradle/compile/java.gradle

45 lines
1,021 B
Groovy
Raw Normal View History

2022-10-20 10:19:32 +02:00
apply plugin: 'java-library'
java {
2023-10-01 08:51:00 +02:00
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
2022-10-20 10:19:32 +02:00
modularity.inferModulePath.set(true)
withSourcesJar()
withJavadocJar()
2022-10-20 10:19:32 +02:00
}
jar {
manifest {
attributes('Implementation-Version': project.version)
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
tasks.withType(JavaCompile) {
2024-03-04 16:03:29 +01:00
doFirst {
options.fork = true
options.forkOptions.jvmArgs += ['-Duser.language=en','-Duser.country=US']
options.encoding = 'UTF-8'
options.compilerArgs.add('-Xlint:all')
options.compilerArgs.add("--module-path")
options.compilerArgs.add(classpath.asPath)
classpath = files()
}
}
tasks.withType(Javadoc) {
2024-03-04 16:03:29 +01:00
doFirst {
options.addStringOption('Xdoclint:none', '-quiet')
options.encoding = 'UTF-8'
}
}
tasks.withType(JavaExec) {
doFirst {
jvmArguments.add("--module-path")
jvmArguments.add(classpath.asPath)
classpath = files()
}
}