Search code examples
gradlekotlingradle-kotlin-dsl

Gradle Kotlin DSL equivalent for Groovy DSL compilerArgs for compileJava


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

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

Solution

  • tasks.withType<JavaCompile> {
        options.compilerArgs.addAll(arrayOf("-parameters", "-Xdoclint:none", "-Xlint:all"))
    }