You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Steve Cohen <SC...@sportvision.com> on 2003/02/03 20:06:53 UTC

Printing a path

On page 80 of Erik Hatcher & Steve Loughran's "Java Development with
Ant" is given a technique for "Obtaining a string representation of a
path".

Following this technique, using a version of ant built a few months ago
(>1.5.1), I find this technique not to work.

        <property name="global.class.path" refid="globallibs"/>
        <echo message="global.class.path=${global.class.path}"/>

produces this output:
global.class.path=org.apache.tools.ant.types.FileSet@6e22f7

Not exactly what I was looking for.  I should mention that this path is
created in a different buildfile, and passed to the one containing this
code via the inheritrefs mechanism.

Has anyone previously encountered this?  Is it a known bug?  

-----------------------------------------------
Steve Cohen
Sr. Software Engineer
Sportvision Inc.
scohen@sportvision.com
http://www.sportvision.com

Please note: As a result of the merger of 
Ignite Sports and Sportvision, my email address 
has changed to scohen@sportvision.com


Re: Printing a path

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
On Monday, February 3, 2003, at 02:06  PM, Steve Cohen wrote:
> On page 80 of Erik Hatcher & Steve Loughran's "Java Development with
> Ant" is given a technique for "Obtaining a string representation of a
> path".

Good reference, I might add :)  But something wrong in what you did....

> produces this output:
> global.class.path=org.apache.tools.ant.types.FileSet@6e22f7

You passed it a reference to a FileSet, not a Path.  Only a Path works 
properly with this trick.

> Not exactly what I was looking for.  I should mention that this path is
> created in a different buildfile, and passed to the one containing this
> code via the inheritrefs mechanism.
>
> Has anyone previously encountered this?  Is it a known bug?

Nope, works as it should, if you pass it a Path.

<pathconvert> might be what you're looking for?

	Erik