ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Wall <>
Subject Conditional target execution based on prerequisite execution
Date Tue, 18 Feb 2003 15:03:31 GMT
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

View raw message