ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject RE: How to echo path?
Date Thu, 05 Apr 2007 06:12:32 GMT
 
Hi,


-----Original Message-----
From: Douglas McCarroll [mailto:list.ant-user.001@brightworks.com] 
Sent: Wednesday, April 04, 2007 11:07 PM
To: Ant Users List
Subject: How to echo path?

/*
I have a path that I'd like to output to the console.

For example:

    <path id="my.path.id">
        <pathelement location="${a.path}"/>
        <pathelement location="${another.path}"/>
    </path>

If I do this:

    <echo message="${my.path.id}" />

I get this:

    [echo] ${my.path.id}
*/

when  i need to echo path id's i always use ${toString: ...}, i.e =

<project name="bla" default="main" basedir=".">

    <target name="depends">
        <path id="my.path.id">
            <pathelement location="c:/jruby-0.9.8/lib/jruby.jar" />
            <pathelement location="c:/PSPad editor/PSPad.exe" />
        </path>
    </target>

    <target name="main" depends="depends">
        <echo message="${toString:my.path.id}" />
    </target>

</project>

and you get :

depends:
main:
     [echo] C:\jruby-0.9.8\lib\jruby.jar;C:\PSPad editor\PSPad.exe
BUILD SUCCESSFUL

The use of ${toString: ...} is not documented and not recommended
by the ant authorities as far as i remember.
That said, i use it very often without any problems til now.
(Ant 1.6.5, Win2000 / 2003 Server, AIX)


Regards, Gilbert

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


Mime
View raw message