ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Ant design & use question: conditional flows in Ant
Date Tue, 04 Nov 2003 07:59:48 GMT
On Mon, 03 Nov 2003, Steve Kelem <> wrote:

> <target name="compile" if="compileI"/>
>  <javac with compileI params.../>
> </target>
> <target name="compile" if="compileII"/>
>  <javac with compileII params.../>
> </target>
> 1. If I have two flows, how do I reconcile both with having a common
> end-goal, namely "all"?

Instead of the above use

<target name="compileI" if="compileI"/>
 <javac with compileI params.../>
<target name="compileII" if="compileII"/>
 <javac with compileII params.../>
<target name="compile" depends="compileI,compileII"/>

> I can't have "all" depend on "deployI" and "deployII", because I
> will not be exercising both flows for a given execution of ant.

The ifs on your targets will prevent them from being executed, don't

> 2. How is the "if" attribute of the "task" useful?

You mean <target>

> The task executes if some property is set,

The target executes if the property is set and will be skipped if not.


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

View raw message