ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject AW: Conditional target execution based on prerequisite execution
Date Tue, 18 Feb 2003 15:23:06 GMT
When you use <target name="B" depends="A"/> the Ant framework will
invoke A before B. Why setting a property?

BTW the "onlyif" is <target if="propertyname"/>
There is a unless="propertyname", too.

Jan Matèrne

-----Urspr√ľngliche Nachricht-----
Von: Timothy Wall []
Gesendet am: Dienstag, 18. Februar 2003 16:04
Betreff: Conditional target execution based on prerequisite execution

How does one configure an ant build script such that target B is
executed if and only if target A has been run?  I realize that this
*can* be accomplished by having target A set a property and B only run
if that property is set, but given that this is such a fundamental
notion in building large, complex projects, I'm surprised that there is
not a more fundamental level of support for it in ant, particularly
given its claims as a "make without the wrinkles". I'm finding ant to
be more of "less flexible make using java, without some of the

I didn't find any reference to such dependency tracking, but perhaps my
terminology is incorrect.

I would expect something like
<target name="A"/>
<target name="B" depends="A" onlyif="A-was-run"/>

Where the idea is that some property "A-was-run" gets set automagically
whenever A is actually run.

If this feature is already in there somewhere, please point me to it.
I'm assuming it's not, since the "depends" documentation explicitly
states that it has absolutely no effect on whether or not a target gets
run, and provides no links to any facility which might have such an

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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message