ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack J. Woehr" <>
Subject Manual verbiage: calling vs dependency
Date Tue, 30 Sep 2003 21:06:25 GMT
May I suggest the following verbiage for somewhere in the Ant manual? I had trouble with
this concept and it seems a lot of newbies do also.

 Calling versus Dependency

    Whenever you call into an Ant target via <antcall> or <ant>, any changes (e.g.,
setting properties)
    by the called target do not propagate back into the caller's environment. This is the
reason targets
    which are the main line of an overall build tend to be referenced via the "depends" attribute,
    changes to the environment (e.g., setting properties) by a target referenced as a depend
*do* modify
    the dependent target's environment.


    <target  name="foo">
        <property name="woof" value="Bow-wow"/>

    <!-- says "Bow-wow" -->
    <target name="bar" depends="foo">
        <echo message="${woof}"/>

    <!-- says "${woof}" of course, uninstanced variable -->
    <target name="surprise">
        <antcall target="bar">
        <echo message="${woof}"/>

Jack J. Woehr      # You measure democracy by the freedom it
Senior Consultant  # gives its dissidents, not the freedom
Purematrix, Inc.   # it gives its assimilated conformists. #         - Abbie Hoffman

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

View raw message