ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: Feature request: ifbool/unlessbool
Date Thu, 24 Sep 2009 13:37:54 GMT


--- On Thu, 9/24/09, Stefan Bodewig <bodewig@apache.org> wrote:

> From: Stefan Bodewig <bodewig@apache.org>
> Subject: Re: Feature request: ifbool/unlessbool
> To: user@ant.apache.org
> Date: Thursday, September 24, 2009, 5:27 AM
> On 2009-09-24, Francis GALIEGUE
> <fge@one2team.com>
> wrote:
> 
> > But ideally, I'd like to use these properties all the
> time, with
> > boolean values. Say, for example, if I have nomail set
> to 1 or true,
> > then no mail is sent; if it's 0 or false, then the
> mail is sent. And
> > the target would then read:
> 
> > <target name="junit-send-report"
> unlessbool="nomail"/>
> 
> Ant 1.8.0[1] and its new PropertyHelper API will help you
> here with the
> plain if/unless attributes.
> 
> unless will pass if the property is either not set at all
> (current Ant
> behavior) or is set and PropertyHelper expands it to
> Boolean.FALSE.
> 
> if will pass if the property is set to anything but
> Boolean.FALSE.
> 
> This only works if you are using a PropertyEvaluator that
> returns
> Boolean instances - and there currently is none, but it
> would be trivial
> to write one.
> 
> Check out Ant's trunk if you want to experiment with it.
> 

I was thinking, "wow, who did that?" but as it turns out, I did it.  :P

-Matt

> Stefan
> 
> [1] there still are a few details of changes in trunk that
> need to be
>     hashed out before we can plan that release.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 


      

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


Mime
View raw message