Using Compiler Arguments with Gradle

Just in case you’re searching for a way to use multiple compiler arguments in your Gradle builds, have a look at this snippet:

subprojects {
    tasks.withType(JavaCompile) {
        options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"

I took the example from stackoverflow, but you can find details at the Gradle DSL for the JavaCompile class.