ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Qazwart <>
Subject Re: Simple if/else Condition
Date Wed, 18 Jul 2007 04:14:13 GMT

On Jul 17, 2007, at 11:18 PM, Evan J wrote:
> if (condition)
>  perform some task, i.e. echo message="condition met"
> else
>  perform another task

Check out the AntContrib tasks at < 
There is actually an <if> ant task at <http://ant->. I've used it quite  
successfully with Ant 1.7.

If you don't want to use optional tasks, you can use the <condition>  
task like this to emulate an <if><else> task:

     <os family="windows"/>
<antcall task="windows_task"/>
<antcall task="unix_task"/>

<task name="windows_task if="os_is_windows">

<task name="unix_task" unless="os_is_windows">

David Weintraub

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

View raw message