ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peterrei...@apache.org>
Subject Re: Conditional (Target) Execution
Date Fri, 08 Oct 2004 16:09:22 GMT
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: dev-unsubscribe@ant.apache.org
>For additional commands, e-mail: dev-help@ant.apache.org
>


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


Mime
View raw message