ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wayne Stidolph <wa...@lutris.com>
Subject Depend on "inherited" target? Depend on local property?
Date Mon, 08 Oct 2001 18:36:32 GMT
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


Mime
View raw message