ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
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 <s_kelem@pacbell.net> 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>
<target name="compileII" if="compileII"/>
 <javac with compileII params.../>
</target>
<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
worry.

> 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.

Stefan

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


Mime
View raw message