There is an <if/> task in ant-contrib that does this:
<if>
  <isset property="prop"/>
  <then>
      <echo>Prop is set</echo>
  </then>
</if>

Peter

Phil Weighill-Smith wrote:

A while back there was a discussion about having a syntax for use in the if and unless attributes of targets. 
It has occurred to me that perhaps we just need a task akin to "sequential" that can have a 
condition data type as its first "child". This condition would determine whether the further 
content of the task would be "executed".

This might look like:

<target name="something">

   <conditional>

       <condition>

           <isset property="a.property.name"/>

       </condition>

       <copy .../>

       ...

   </conditional>

</target>

This example would be equivalent to using the if attribute, but the full power 
of condition could be applied.

In addition, this would allow any sub-part of a target (including the default 
target) to be made conditional without resorting to the use of properties.

Have I missed an existing Ant capability, or would this be a worthy enhancement?

Phil Weighill-Smith



------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to