Both antcontrib[1] and antelope[2] provide if/else constructs. Either of these would work for your situation.
Dale [1] http://ant-contrib.sourceforge.net [2] http://antelope.tigris.org On Thu, Sep 24, 2009 at 7:37 AM, Matt Benson <[email protected]> wrote: > > > --- On Thu, 9/24/09, Stefan Bodewig <[email protected]> wrote: > >> From: Stefan Bodewig <[email protected]> >> Subject: Re: Feature request: ifbool/unlessbool >> To: [email protected] >> Date: Thursday, September 24, 2009, 5:27 AM >> On 2009-09-24, Francis GALIEGUE >> <[email protected]> >> 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: [email protected] >> For additional commands, e-mail: [email protected] >> >> > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
