How can I set the compileOptions for my Gradle Java plugin?

后端 未结 4 1612
失恋的感觉
失恋的感觉 2020-12-07 00:39

I want to set the -parameters command on my gradle build so that I can use reflection to access the name of the parameters. It seems like I should be doing this with the fol

4条回答
  •  余生分开走
    2020-12-07 01:35

    tasks.withType(JavaCompile) {
        configure(options) {
            options.compilerArgs << '-Xlint:deprecation' << '-Xlint:unchecked' // examples
        }
    }
    

    Source: http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.compile.CompileOptions.html

提交回复
热议问题