Hi,

-----Original Message-----
From: Douglas McCarroll [mailto:[EMAIL PROTECTED] 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to