ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Rodriguez <>
Subject setting a property based on a condition
Date Thu, 23 Aug 2001 19:29:00 GMT
Quick question:

Is there any way to set a property in ant based on a condition? For example,
say I have a boolean property named "foo".  Now I want to set a property
named "num" to 1 if foo is true or set num to 2 if foo is false.  Here is
some pseudo ant to better explain my question:

<target name="init">
	<property name="foo" value="true"/>
	<property name="num"  if ${foo} value="1" else value="2"/>

Any way to do this in ant?  Thanks for any help.


View raw message