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?
Thanks
phil
On Wed, Sep 28, 2011 at 11:07 AM, Luke Daley <[email protected]> wrote:
> It's the same syntax.
>
> To set it for all Java and Groovy compile tasks:
>
> tasks.matching { it instanceof Compile || it instanceof GroovyCompile }.all {
> options.compilerArgs << "-Xlint:unchecked"
> }
>
>
> On 28/09/2011, at 5:20 PM, phil swenson wrote:
>
>> anyway to do this for groovy?
>>
>> thanks
>> phil
>>
>> On Fri, Sep 2, 2011 at 11:51 AM, Luke Daley <[email protected]>
>> wrote:
>>>
>>> On 30/08/2011, at 5:47 PM, phil swenson wrote:
>>>
>>>> Is there a way to break a gradle build if there is a compile warning?
>>>> People are ignoring the compiler warnings, and this would be a stop to
>>>> it :)
>>>
>>> This should work:
>>>
>>> compileJava {
>>> options.compilerArgs << "-Werror"
>>> }
>>>
>>> Inspiration taken from this SO post:
>>> http://stackoverflow.com/questions/1040074/javac-treat-warnings-as-errors
>>>
>>> --
>>> Luke Daley
>>> Principal Engineer, Gradleware
>>> http://gradleware.com
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>> http://xircles.codehaus.org/manage_email
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>> http://xircles.codehaus.org/manage_email
>>
>>
>
> --
> Luke Daley
> Principal Engineer, Gradleware
> http://gradleware.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email