• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Echoing the content of a path

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I declare a path in a ant-build file, like herebelow :

How can I echo the content of the variable used in the refid in the ant-console ?

Basically,
I do not want to use the '-debug' or the '-verbose' switch to the ant command.

Tx,

Thomas,
[ September 23, 2004: Message edited by: Bear Bibeault ]
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We echo a property set to the refid. Anyone have another solution?

Here's the xml followed by the output...

<project name="javaranch.question"
default="compile" basedir=".">

<property name="lib.dir" value="lib" />
<property name="build.dir" value="dist" />


<target name="set.classpath" >
<path id="classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<path id="runtime.classpath">
<path refid="classpath"/>
<pathelement location="${build.dir}"/>
</path>
</target>

<target name="compile"
depends="set.classpath" >
<!-- do your compilation stuff here -->
<property name="my.classpath"
refid="classpath" />
<property name="my.runtime.classpath"
refid="runtime.classpath" />
<echo> classpath=${my.classpath} </echo>
<echo>
runtime.classpath=${my.runtime.classpath}
</echo>
</target>

</project>

I ran that in a directory with a lib directory with some jars and here's the output...

Buildfile: new.xml

set.classpath:

compile:
[echo] classpath=/home/01/cenderl/qcoppty/lib/junit.jar:/home/01/cenderl/qcoppty/li
b/log4j.jar:/home/01/cenderl/qcoppty/lib/client.jar:/home/01/cenderl/qcoppty
/lib/httpclient.jar:/home/01/cenderl/qcoppty/lib/xercesImpl.jar:/home/01/cen
derl/qcoppty/lib/jdom.jar:/home/01/cenderl/qcoppty/lib/servlet.jar:/home/01/
cenderl/qcoppty/lib/GLUE-STD.jar:/home/01/cenderl/qcoppty/lib/jnet.jar:/home
/01/cenderl/qcoppty/lib/omr-qcentral-prod.jar:/home/01/cenderl/qcoppty/lib/o

mr-qcentral
.jar:/home/01/cenderl/qcoppty/lib/xerces.jar:/home/01/cenderl/qcoppty/lib/cg
tClient.jar:/home/01/cenderl/qcoppty/lib/struts.jar
[echo]
[echo] runtime.classpath=/home/01/cenderl/qcoppty/lib/junit.jar:/home/01/cenderl/q
coppty/lib/log4j.jar:/home/01/cenderl/qcoppty/lib/client.jar:/home/01/cende
rl/qcoppty/lib/httpclient.jar:/home/01/cenderl/qcoppty/lib/xercesImpl.jar:/
home/01/cenderl/qcoppty/lib/jdom.jar:/home/01/cenderl/qcoppty/lib/servlet.j
ar:/home/01/cenderl/qcoppty/lib/GLUE-STD.jar:/home/01/cenderl/qcoppty/lib/j
net.jar:/home/01/cenderl/qcoppty/lib/omr-qcentral-prod.jar:/home/01/cenderl
/qcoppty/lib/
omr-qcentral.jar:/home/01/cenderl/qcoppty/lib/xerces.jar:/home/01/cenderl/q
coppty/lib/cgtClient.jar:/home/01/cenderl/qcoppty/lib/struts.jar:/home/01/c
enderl/qcoppty/dist
[echo]

BUILD SUCCESSFUL
Total time: 3 seconds
[ September 23, 2004: Message edited by: Bear Bibeault ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks! This helped me real quick!
 
Sheriff
Posts: 67682
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"VJ CALDUDE",

We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious. And please make it not in all uppercase!

Thanks!
bear
Forum Bartender
 
Bear Bibeault
Sheriff
Posts: 67682
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
P.S. I edited Carol's reply for formatting.
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic