ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Giroux" <>
Subject Re: Simple if/else Condition
Date Fri, 27 Jul 2007 13:15:54 GMT
Hi Evan,

On 7/17/07, Evan J <> wrote:

> if (condition)
>  perform some task, i.e. echo message="condition met"
> else
>  perform another task
> Is there such task available in Ant 1.7?

This can be accomplished by wrapping the tasks in individual targets
then defining a target that drives the others via depends:
<condition property="">
  <!-- your test hee -->
<target name="t1" if="">
  <echo>condition was true</echo>
<target name="t2" unless="">
  <echo>condition was false</echo>

<target name="driver" depends="t1,t2">
  <!-- if then t1 is executed else t2 is executed -->

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message