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 18:44:14 GMT
thats weird. this response was geared towards Mike, however i did  
provide a similar answer to Guy earlier.

yea it seems that what you had is more in line with what he wants.


On Aug 14, 2008, at 11:57 AM, Scot P. Floess wrote:

> This is true.  However, I think Guy wants to take some action if a  
> property is set.  Therefore the <isset../> is what he probably ought  
> to use :)
>
> On Thu, 14 Aug 2008, Steven Guitar wrote:
>
>> 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
>>
>
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC  27549
>
> 252-478-8087 (Home)
> 919-754-4592 (Work)
>
> Chief Architect JPlate   http://sourceforge.net/projects/jplate
> Chief Architect JavaPIM  http://sourceforge.net/projects/javapim
>
> Architect Keros          http://sourceforge.net/projects/keros
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>


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


Mime
View raw message