Java Mailing List Archive

Apache Ant Archive

» Ant Users List
» Ant Developers List
How to echo path?

How to echo path?

2007-04-05       - By Rebhan, Gilbert
Reply:     1     2     3     4     5     6     7     8     9     10  


-----Original Message-----
From: Douglas McCarroll [mailto:list.ant-user.001@(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="">
       <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: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 - Jax Systems, LLC, U.S.A.