You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Vimil Saju <vi...@yahoo.com> on 2011/07/21 23:16:48 UTC

optional depends for targets

Hi,

Is it possible for a target to optionally depend on another target? For example consider 

target A has an optional dependency on target B 
target C depends on target A

When the build is invoked with target C then only targets A and C should get executed in the order A,C. However if the build is invoked with targets C,B,A then the targets should be executed in the order B, A, C.

Thanks
Vimil

AW: optional depends for targets

Posted by "Knuplesch, Juergen" <Ju...@icongmbh.de>.
I Use the <if> from antcontrib to achieve this.

-----Ursprüngliche Nachricht-----
Von: Vimil Saju [mailto:vimilsaju@yahoo.com] 
Gesendet: Donnerstag, 21. Juli 2011 23:17
An: Ant Users List
Betreff: optional depends for targets

Hi,

Is it possible for a target to optionally depend on another target? For example consider 

target A has an optional dependency on target B 
target C depends on target A

When the build is invoked with target C then only targets A and C should get executed in the order A,C. However if the build is invoked with targets C,B,A then the targets should be executed in the order B, A, C.

Thanks
Vimil

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


RE: optional depends for targets

Posted by David Sills <DS...@datasourceinc.com>.
This is how I deal with that: simply set up two (I call them) synthetic targets. One depends on A and C, the other on B, A, and C. Then call one or the other of them. They only need the depends:

<target name="buildForProduction" depends="B,A,C"/>

-----Original Message-----
From: Vimil Saju [mailto:vimilsaju@yahoo.com] 
Sent: Thursday, July 21, 2011 5:17 PM
To: Ant Users List
Subject: optional depends for targets

Hi,

Is it possible for a target to optionally depend on another target? For example consider 

target A has an optional dependency on target B 
target C depends on target A

When the build is invoked with target C then only targets A and C should get executed in the order A,C. However if the build is invoked with targets C,B,A then the targets should be executed in the order B, A, C.

Thanks
Vimil

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