Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

ant - howto echo <path id=...>

Thread view: 
coltrane - 14 Jun 2006 19:09 GMT
I am sure this question has been asked and answered but.....

Is it possible to echo an refid?

ie.
<path id="classpath">
    <pathelement location="${common_lib.dir}/xpp3.jar"/>
    <pathelement location="${common_lib.dir}/jibx-run.jar"/>
    <pathelement location="${common_lib.dir}/jibx-bind.jar"/>
    <pathelement location="${common_lib.dir}/oracle/ojdbc.jar"/>
    <pathelement location="${common_lib.dir}/oracle/classes12.jar"/>
    <pathelement location="${tomcat.dir}/common/lib/servlet-api.jar"/>
</path>
<echo message="refid classpath"/>

Thanks for the help

john
Gilbert Rebhan - 14 Jun 2006 20:31 GMT
Hi,

> I am sure this question has been asked and answered but.....
>
[quoted text clipped - 8 lines]
> </path>
> <echo message="refid classpath"/>

yup, there's a 'hack' with refid's / id's (undocumented)
the ant developers say one shouldn't use it, as it could be
altered in the next ant version.
that said, i use it a lot ;-)

just put the line
<echo message="${toString:classpath}"/>
instead of <echo message="refid classpath"/>
and you have it all on one line separated with ';'

with antcontrib or antelope <for> task you may do things like =

<for list="${toString:classpath}" param="pathitem" delimiter=";">
<sequential>
 <echo>pathitem == @{pathitem}${line.separator}</echo>
</sequential>
</for>

[1] http://ant-contrib.sourceforge.net/
[2] http://antelope.tigris.org/

bye4now, Gilbert

P.S.:

if you're using ant regularly subscribe the ant user list - recommended

the antelope tasks should have been merged into antcontrib
but that ain't finished, so i use both.

there might also be another (somewhat 'cleaner') way via <pathconvert>
task that ships with ant, just have a look into the ant manual.
coltrane - 14 Jun 2006 21:41 GMT
> Hi,
>
[quoted text clipped - 43 lines]
> there might also be another (somewhat 'cleaner') way via <pathconvert>
> task that ships with ant, just have a look into the ant manual.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.