ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amshoff <>
Subject Order of property tasks relevant?
Date Thu, 07 Sep 2000 09:09:03 GMT

I just started with Ant (Release 1.1, Win NT) and am wondering
about the way properties are resolved.

For example: given the following buildfile

<?xml version="1.0"?>
<project name="JJSys" default="main" basedir=".">
  <target name="main" depends="A">
    <echo message="var is '${var}'" />
  <target name="A" depends="B">
    <echo message="var is '${var}'" />
  <target name="B">
    <property name="var" value="some value"/>
    <echo message="var is '${var}'" />

and building the default target 'main' I would expect the
property 'var' to be set in all targets 'main', 'A' and 'B'.
In fact, the output is

Buildfile: test.xml

var is 'some value'

var is '${var}'

var is '${var}'


It seems to make a difference where the definition of the
property (and target 'B') is noted in the buildfile, because
if I swap the definition of targets 'B' and 'A' in the code,
'var' is resolved in 'A', too.
Thus, the properties are resolved only at locations in the
buildfile which are below their definition task? This is IMHO
not documented in the user manual.
Is it a feature? Or a bug?

Thanks for any help on this.

View raw message