ant-user mailing list archives

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

-----Original Message-----
From: Douglas McCarroll [] 
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="">
        <pathelement location="${a.path}"/>
        <pathelement location="${another.path}"/>

If I do this:

    <echo message="${}" />

I get this:

    [echo] ${}

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="">
            <pathelement location="c:/jruby-0.9.8/lib/jruby.jar" />
            <pathelement location="c:/PSPad editor/PSPad.exe" />

    <target name="main" depends="depends">
        <echo message="${}" />


and you get :

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

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:
For additional commands, e-mail:

View raw message