ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Guitar <stgui...@mac.com>
Subject Re: I can't use the <if>task
Date Thu, 14 Aug 2008 16:50:29 GMT
you should try this...

<target name="displayPropIfExists" if=${myprop} >
	<echo>${myprop}</echo>
</target>

this is a silly example, but the idea is that if and only if the  
property exists, the given target will run. unless is used in the  
opposite manner.

you could also do straight if conditional checking with:

<if>
	<equals arg1="somevalue" arg2="somevalue" />
	<then>
		do stuff
	</then>
	<else>
		do other stuff
	</else>
</if>

note that the arguments can be properties

On Aug 12, 2008, at 11:12 AM, Mike Garcia wrote:

> Hello,
>
>
>
> I have added the if task around some exec statements because I don't
> want them executed if a property is set.  Something like this:
>
>
>
> <if name="skipclean" value="true">
>
>                ... do stuff
>
> </if>
>
>
>
> This fails to execute and I get the error message: Problem: failed to
> create task or type if. Do I need to install something else?  I have  
> Ant
> 1.7.0 installed, nothing else.
>
>
>
> Thanks,
>
> -Mike
>


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


Mime
View raw message