You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ml...@VegInfo.com on 2002/05/03 00:48:53 UTC

[newbie] How to display values pointed to by refid

This is a newbie question. In a build.xml (tomcat), pathelement and
fileset are used to create a path with id of "compile.classpath" and
used in many places. How do I display the values generated? 

This on an NT system. No luck in using echo or exec [to run an 
external bat file] in the build.xml file to display the values.
Obviously I must be missing something really basic :-(  Tried
searching list archive, but could not find the answer. Can anyone
post a code snippet to display values pointed to by a refid?
Any help will be appreciated!

das

p.s. The generated values or usage seem to be wrong as I can
     compile by commenting out the classpath. The usage is
     <classpath refid="compile.classpath"/>. Tried running with
     -verbose and -debug. The incorrect directory path appears
     only at point of usage [somehow pwd - current working
     directory - seems to get added in front of a proper value].

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [newbie] How to display values pointed to by refid

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message ----- 
From: <ml...@VegInfo.com>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Saturday, May 04, 2002 08:39
Subject: Re: [newbie] How to display values pointed to by refid


> In case anybody is wondering what the problem/fix was, it is
> even more mysterious. I had supplied catalina.home as
> F:\jwsdp-1_0-ea2 in build.properties file. When ant
> processed this file, it stripped "\" character to make
> catalina.home=F:jwsdp-1_0-ea2 (essentially made it relative
> path, instead of absolute path). This relative value was used
> in the creation of a path (pointed to refid compile.classpath).
> Now Windows prefixed current working directory to catalina.home
> value resulting in the "offending entry." Whew! (At least this
> is what I suspect happened. Your reality may be different! :-)
> 
> F:\\jwsdp-1_0-ea2 (an additional "\") in build.properties
> file fixed the problem.

not that mysterious; it is the normal behaviour of Java.util.properties. 

Use forward slashesand all is well


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [newbie] How to display values pointed to by refid

Posted by ml...@VegInfo.com.
Diane Holt wrote:
> <property name="whatever" refid="compile.classpath"/>
> <echo>compile.classpath = ${whatever}</echo>
> > BUILD FAILED (because of an incorrect entry in compile.classpath)
> You'll need to fix the "incorrect entry" before you can do anything else.

Thanks Diane. You are right. I fixed the "offending entry" in
compile.classpath. Now the statements you supplied work!

This looks like a catch-22. I wanted to display compile.classpath
to find what was wrong with it (debug the problem). Yet until
everything was correct, the contents could not be displayed :-(
The current behavior forced me to work blind. IMHO the statement
<property name= ...> should accept the directory entries pointed
to by refid (not validate whether they exist or not) so that they
can be displayed by the next echo statement.

In case anybody is wondering what the problem/fix was, it is
even more mysterious. I had supplied catalina.home as
F:\jwsdp-1_0-ea2 in build.properties file. When ant
processed this file, it stripped "\" character to make
catalina.home=F:jwsdp-1_0-ea2 (essentially made it relative
path, instead of absolute path). This relative value was used
in the creation of a path (pointed to refid compile.classpath).
Now Windows prefixed current working directory to catalina.home
value resulting in the "offending entry." Whew! (At least this
is what I suspect happened. Your reality may be different! :-)

F:\\jwsdp-1_0-ea2 (an additional "\") in build.properties
file fixed the problem.

das

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [newbie] How to display values pointed to by refid

Posted by Diane Holt <ho...@yahoo.com>.
--- mls@VegInfo.com wrote:
> Diane Holt wrote:
> >   <property name="whatever" refid="compile.classpath"/>
> >   <echo>compile.classpath = ${whatever}</echo>
> 
> Thanks for your suggestion, Diane. It seems that it did not work me.

That'd be because...

>     BUILD FAILED 
>     (because of an incorrect entry in compile.classpath)

You'll need to fix the "incorrect entry" before you can do anything else.

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [newbie] How to display values pointed to by refid

Posted by ml...@VegInfo.com.
Diane Holt wrote:
>   <property name="whatever" refid="compile.classpath"/>
>   <echo>compile.classpath = ${whatever}</echo>

Thanks for your suggestion, Diane. It seems that it did not work me.
So I put in few echo statements around your suggestion.
    <echo>Start of new code</echo>
    <property name="whatever" refid="compile.classpath"/>
    <echo>After property set</echo>
    <echo>compile.classpath = ${whatever}</echo>
    <echo>End of new code</echo>

and here is the output ---------
	[echo] Start of new code
    (and after a blank line)
    BUILD FAILED 
    (because of an incorrect entry in compile.classpath)

Even the echo message "After property set" did not show up.
Am I missing something here? Are echo messages somehow
buffered by ant?

das

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [newbie] How to display values pointed to by refid

Posted by Diane Holt <ho...@yahoo.com>.
--- mls@VegInfo.com wrote:
> This is a newbie question. In a build.xml (tomcat), pathelement and
> fileset are used to create a path with id of "compile.classpath" and
> used in many places. How do I display the values generated? 

  <property name="whatever" refid="compile.classpath"/>
  <echo>compile.classpath = ${whatever}</echo>

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>