On 28/09/2011, at 9:15 PM, phil swenson wrote:
> I'm sure you meant -Werror instead of -Xlint:unchecked
>
> In any case it doesn't seem to do anything on the java tasks (I put in
> some deprecated uses an get the compiler warning
>
> I tried both
>
> (in my build.gradle)
> compileJava {
> options.compilerArgs << "-Werror"
> }
>
> and your tasks.matching approach. I see the warnings output and the
> process keeps going.
>
> Have you made this work in your env?
We turn unchecked warnings on in the Gradle build.
https://github.com/gradle/gradle/blob/master/gradle/groovyProject.gradle#L24
I did a bit of experimenting with turning warnings into errors, and it's a two
step process. First you need to turn on the warning and then add -Werror
tasks.withType(Compile).all {
options.compilerArgs << "-Xlint:all" << "-Werror"
}
However, there is a bit of weirdness with trying to do this for the
GroovyCompile tasks. You need to do this:
tasks.withType(GroovyCompile).all {
options.compilerArgs << "-Xlint:all" << "-FWerror"
}
Notice that it's "-FWerror". Groovyc seems to do some kind of escaping for
arguments destined for javac, but misses the -Werror option. I think this is
because -Werror is a “hidden” option of javac.
--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email