ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Evan J " <maps.this.addr...@gmail.com>
Subject Re: Simple if/else Condition
Date Wed, 18 Jul 2007 14:11:27 GMT
Thank you Qazwart, except that we don't have `task' task but rather
`target' for antcall. Either way, it should get the job done.

Now I have to figure out to see how I can check whether a directory
(and its subdirectories) are empty -- Length doesn't help.

On 7/18/07, Qazwart <qazwart@gmail.com> wrote:
>
> 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 <http://ant-contrib.sourceforge.net/
> tasks/tasks/index.html>.
> There is actually an <if> ant task at <http://ant-
> contrib.sourceforge.net/tasks/tasks/if.html>. 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:
>
> <condition
>      property="os_is_windows"
>      value="true">
>      <os family="windows"/>
> </condition>
> <antcall task="windows_task"/>
> <antcall task="unix_task"/>
>
> <task name="windows_task if="os_is_windows">
>      <blah>
>      </blah>
> </task>
>
> <task name="unix_task" unless="os_is_windows">
>      <blah>
>      </blah>
> </task>
>
> David Weintraub
> david@weintraub.name
> qazwart@gmail.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Mime
View raw message