You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by os...@ns.rvsnet.cz on 2005/11/17 11:23:44 UTC

Adding elements to a path

Hello all,

I need to add elements to an existing path. I have this problem solved,
but it is not nice. I do it this way

<macrodef name="addToMyPath">
    <attribute name="newPath" />
    <sequential>
        <property name="temp" refid="myPath" />
        <path id="myPath">
            <pathelement path="@{newPath}" />
            <pathelement path="${temp}" />
        </path>
    </sequential>
</macrodef>

It works (with slight modifications also when called more times), but it
1) is a horrible hack
2) prints a warning each time about overriding myPath reference

Please, is there a better way to do this? I can't believe that such
powerfull tool as ant lacks such basic feature.

Best regards,

Ondrej Svetlik

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org