ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Cohen" <SCo...@sportvision.com>
Subject RE: echo true or false
Date Wed, 05 Feb 2003 21:33:08 GMT
Doh! Of course!  Sort of like the opposite of java programming where,
instead of if ... else, you set a variable to a default value, and then
if (some condition) you reset it to something else, only with ant, it's
the reverse, you try to set it afterward, which will only work if you
didn't set it the first time.

Still, one might hope for a better syntax than that.

Sheesh - if I ALSO want to use that property as an "if" or "unless"
parameter, I'm screwed again, right?  Can't go setting it to false.  I
have to use your trick to define a SECOND property based on the first
for display purposes.

Oh, well....

-----Original Message-----
From: David McTavish [mailto:dmctavish@SANDVINE.com] 
Sent: Wednesday, February 05, 2003 3:16 PM
To: 'Ant Users List'
Subject: RE: echo true or false


<condition property="my.property>
	... whatever tests
</condition>
<property name="my.property" value="false"/>
<echo .../>

If you set the property AGAIN, after the condition, it won't reset the
property if it was previously set to "true", BUT, it will set it if it
is still null.

d.

-----Original Message-----
From: Steve Cohen [mailto:SCohen@sportvision.com]
Sent: Wednesday, February 05, 2003 4:09 PM
To: Ant Users List
Subject: echo true or false


The <available>, <condition>, etc. set of tasks all work by setting a
property if a condition is met.  My problem is that I would like to echo
the results of this test.  
<condition property="my.property>
	... whatever tests
</condition>
<echo message="my.property=${my.property}"/>

If the property is set,
"true" will be echoed.  If it hasn't been set, "${my.property}" will be
echoed.

Pretty ugly.  I would like "false" to be echoed.

I would like the ability to set a property true or false depending on
the results of a conditional test.

What is the easiest way to accomplish what I am after?


-----------------------------------------------
Steve Cohen
Sr. Software Engineer
Sportvision Inc.
scohen@sportvision.com
http://www.sportvision.com

Please note: As a result of the merger of 
Ignite Sports and Sportvision, my email address 
has changed to scohen@sportvision.com


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


Mime
View raw message