ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hari Kodungallur" <>
Subject Re: conditions and property's
Date Wed, 13 Nov 2002 19:41:29 GMT
actually, it will be very helpful for me also to know whether we 
can unset a property.

scott, however, you can use the <if> task provided by ant-contrib 
(its on sourceforge 
as a work around. thats what i am doing now

say the value of the property "" can be either 
"true" or "false"

then you can do something like

     <equals arg1="${}" arg2="true"/>


On Wed, 13 Nov 2002 Klein, Scott @ TW wrote :
>OK. So I have determined that Ant is currenty not capable of 
>doing the
>following within a single task (if I'm wrong, please correct 
> 	if condition exists, do stuff
> 	else stop executing script
>however, in order to make my targets re-useable for a variety of 
>purposes I
>require my properties to be UNset after they are checked:
> 	<target name="checkErrorForFoo" unless="bar">
> 		<fail />
> 	</target>
> 	<target name="foo" if="bar">
> 		.. do some stuff ..
> 		?? unset the property bar ??
> 	</target>
> 	<target name="foobar">
> 		<condition name="bar">
> 			.. whatever ..
> 		</condition>
> 		<antcall target="checkErrorForFoo">
> 		<antcall target="foo">
> 		<condition name="bar">
> 			.. whatever ..
> 		</condition>
> 		<antcall target="checkErrorForFoo">
> 		<antcall target="foo">
> 	</target>
>So I only want target "foo" to execute under certain conditions, 
>once the property is set there is no way to unset it. Say I want 
>foo to be
>copyFile then I need to have copyFileForTarget1 
>copyFileForTarget2 - plus
>all of the properties and error checks (which is another 
>I've read that something much easier is being promised in Ant2, 
>shouldn't simple logic be supported already? It just seems 
>strange to me
>that it is not.
>Anyway, if there is a simple solution to this that I've missed I 
>would love
>to hear about it.
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 

Give your Company an email address like
ravi @  Sign up for Rediffmail Pro today!
Know more.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message