ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Ayers" <may...@NEVIKNETWORKS.com>
Subject RE: Conditional target execution based on prerequisite execution
Date Tue, 18 Feb 2003 16:05:04 GMT

> From: Timothy Wall [mailto:twall@oculustech.com]
> Sent: Tuesday, February 18, 2003 7:04 AM

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

	If target B depends only on target A, then target B will be run only if target A was run,
and your "onlyif" clause is moot.

	In other words:

<target name="A" depends=target.A.dependencies />
<target name="B" depends="A" />

	is precisely equivalent to:

	A: $target_A_dependencies

	B: A

	...in a Makefile.  Note that this works only if B has only A as a dependency, just like in
make, and that therefore you could just merge the two targets, just like in make.

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

	Huh?  Where did you read that?  The "Targets" subsection of "Using Ant" in the manual ( http://ant.apache.org/manua,
can't link the page because it's done in frames :-p ) says no such thing, as far as I can
tell.  I think maybe you misread the second paragraph, which can be confusing.


	Good luck,

/|/|ike

Mime
View raw message