Kotlin DSL equivalent for Groovy DSL compileJava.options.compilerArgs


(Ross Goldberg) #1

For the Java plugin, what is the Kotlin DSL equivalent for the following Groovy DSL?

compileJava {
    options.compilerArgs += ['-Xdoclint:all,-missing', '-Xlint:all']
}

(Ross Goldberg) #2

I received a solution to this from Stack Overflow:

tasks.withType<JavaCompile> {
	val compilerArgs = options.compilerArgs
	compilerArgs.add("-Xdoclint:all,-missing")
	compilerArgs.add("-Xlint:all")
}