Dunno why I thought I needed "hasProperty"

But if I pass in -PprofilingEnabled=false, groovy would evaluate
project.profilingEnabled as true because the property is a string set
to "false"

In other words, in a conditional groovy evaluates "false" as true.

groovy> value = "false"
groovy> if (value){
groovy>  println "true"
groovy> }
true

I think I need to do this:
if (project.properties.profilingEnabled == "true"){
   runAEJvmArguments << "-agentlib:yjpagent"
}



On Wed, May 16, 2012 at 9:51 AM, Luke Daley <[email protected]> wrote:
>
> On 16/05/2012, at 4:40 PM, phil swenson wrote:
>
>> if (project.hasProperty("profilingEnabled") && project.profilingEnabled) {
>>        runAEJvmArguments << "-agentlib:yjpagent"
>> }
>>
>> seems a bit verbose to me….
>
> if (project.properties.profilingEnabled) {
>       runAEJvmArguments << "-agentlib:yjpagent"
> }
>
> --
> 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


Reply via email to