You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Wayne Stidolph <wa...@lutris.com> on 2001/10/08 20:36:32 UTC
Depend on "inherited" target? Depend on local property?
I think both my questions get a quick 'no' but thought Id ask in case my
experimenting was off somehow...
(1) Suppose I have three build files (A, B C). If a target in A does an
<ant file="B" ...> can the targets in B depend on targets in A? And,
extending that, if some target in B does <ant file="C" ...> can targets
in C depend on targets in A or B? (Essentially, does the Ant task
establish a nested scope with automatic searching up the call stack?)
(2) Suppose I want to read/set a property in a build file and then use
that property to name a dependency in that same build.xml; is there a way?
I think not, because the depend tree is sorted out before any properties
get read/set, so this won't work:
<project name="dummy" default="main">
<target name="init">
<property name="target.foo" value="foo" />
</target>
<target name="foo">
<echo>Hello from foo!</echo>
</target>
<target name="main" depends="init,${target.foo}">
</target>
</project>
Is that right? Generally, would it work to write a wrapper script to
read in the properties, then do an <ant file="realfile" ...> to get the
property-driven dispatch I seek?
Thx for insight! (And, if developers are reading, thanks for Ant; it's
tres cool!)
Wayne Stidolph