use configureEach

This commit is contained in:
Jörg Prante 2024-04-05 15:31:06 +02:00
parent 75d5f6b2e6
commit 94fb54f6b8

View file

@ -16,10 +16,10 @@ jar {
duplicatesStrategy = DuplicatesStrategy.INCLUDE duplicatesStrategy = DuplicatesStrategy.INCLUDE
} }
tasks.withType(JavaCompile) { tasks.withType(JavaCompile).configureEach {
doFirst { doFirst {
options.fork = true options.fork = true
options.forkOptions.jvmArgs += ['-Duser.language=en','-Duser.country=US'] options.forkOptions.jvmArgs += ['-Duser.language=en', '-Duser.country=US']
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
options.compilerArgs.add('-Xlint:all') options.compilerArgs.add('-Xlint:all')
// enforce presence of module-info.java // enforce presence of module-info.java
@ -29,14 +29,14 @@ tasks.withType(JavaCompile) {
} }
} }
tasks.withType(Javadoc) { tasks.withType(Javadoc).configureEach {
doFirst { doFirst {
options.addStringOption('Xdoclint:none', '-quiet') options.addStringOption('Xdoclint:none', '-quiet')
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
} }
} }
tasks.withType(JavaExec) { tasks.withType(JavaExec).configureEach {
doFirst { doFirst {
jvmArguments.add("--module-path") jvmArguments.add("--module-path")
jvmArguments.add(classpath.asPath) jvmArguments.add(classpath.asPath)