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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to