ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: if/unless Attributes
Date Thu, 24 Sep 2009 17:37:20 GMT


--- On Thu, 9/24/09, Dominique Devienne <ddevienne@gmail.com> wrote:

> From: Dominique Devienne <ddevienne@gmail.com>
> Subject: Re: if/unless Attributes
> To: "Ant Developers List" <dev@ant.apache.org>
> Date: Thursday, September 24, 2009, 12:15 PM
> On Thu, Sep 24, 2009 at 10:46 AM,
> Stefan Bodewig <bodewig@apache.org>
> wrote:
> > On 2009-09-24, Dominique Devienne <ddevienne@gmail.com>
> wrote:
> >> we have ${toString:foo}, we might as well call it
> ${toBoolean:foo} to
> >> be consistent,
> >
> > toString applies to project references, not
> properties, so they would
> > not be as symmetric as they look.
> 
> True. Which makes me think ${toBoolean:ref} would / should
> evaluate to true or
> false when the reference is defined or not. --DD

Okay, the evaluator *I* am talking about :) will evaluate a string using Project.toBoolean(String)
(if you want to evaluate another property use the NestedPropertyExpander and go for it). 
So, very basically, what I  currently have is ${boolean:[on|yes|true]} evaluates to Boolean.TRUE.

Alternatives:

${boolean:true}
${toBoolean:true} //asymmetric to toString:ref
${isTrue:true}
${booleanValue:true}

...others?

-Matt

> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 
> 


      

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message