ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ondřej Světlík <>
Subject Adding reference while parsing a file
Date Wed, 30 Nov 2005 14:41:19 GMT
Hello all,

why the hell is ant adding reference while parsing a file? I have a very
simple example:

file 1: build.xml

<project name="path" default="all">
<import file="makro.xml" />
<target name="all">
        <pokus cesta="/tmp" />
        <property name="path1" refid="path1" />
        <echo message="${path1}" />

file 2: makro.xml
<project name="makro">
<macrodef name="pokus">
        <attribute name="cesta" />
                <property name="temp" refid="path1" />
                <path id="path1">
                        <pathelement path="${temp}" />
                        <pathelement path="@{cesta}" />

Calling ant should fail, because I call macro pokus without existing
reference path1, but it doesn't fail:

ondra:~/tmp/ant/path> ant
Buildfile: build.xml

Overriding previous definition of reference to path1

Total time: 0 seconds

Running ant -d gives me an answer, but that's all wrong:

ondra:~/tmp/ant/path> ant -d | grep path1
Adding reference: path1
Adding reference: path1
Overriding previous definition of reference to path1
Adding reference: path1
Setting project property: path1 ->

Ant adds the reference 3 times. It seems like the reference is added each
time the parser finds <path id="..." />.

Is this really what it should be? I'm using ant-1.6.5 installed from
binary package directly from apache site.

Best regards

Ondrej Svetlik

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

View raw message