On 4/5/07, Rebhan, Gilbert <Gilbert.Rebhan@huk-coburg.de> wrote:
>
> 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.
It is not documented, and the comments in the code do not recommend
it, However I would!.
Peter
> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
|