You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by DevKon <de...@rogers.com> on 2003/12/31 16:53:07 UTC

and -

Regarding <classpath> :

>From the manual:

////
   <classpath>
      <pathelement path="${classpath}"/>
    </classpath>
///

What is ${classpath} referring to? Also, how do I get to print variables or properties <echo>${classpath}/<echo> prints "${classpath}", how do I get the actual value?


Regarding <path>:  what is <path> exactly - a type, a task etc.  I see path definitions in various example scripts but haven't seen a formal definition in the docs.

TIA







Re: and -

Posted by DevKon <de...@rogers.com>.
Thanks for the response, your time and effort is greatly appreciated.

I have been looking at the Ant docs  -
http://ant.apache.org/manual/using.html#path is where I took the code
snippets from.  I have to admit my question was not clear- going trough
tutorials gives me a headache.  I like very concise, formalized
descriptions.

Re <path>:
I've been looking for a description (similar to DTD or XSD) of the
build.xml file, haven't been able to find one.

The manual states that  a project consists of targets, targets are composed
by tasks etc, so I would expect nothing but target definitions within a
<project> tag . I have been looking at the docs and I DON"T SEE <path> tag
explanation or definition; the fact that I could actually define <path> tag
within the <project > tag in my tests confuses me. I understand - I can
define PATHs and have IDs for referrence purposes, but ... I would like to
see definition - black on white

Re <classpath>:
I've seen many build.xml examples referring to a "classpath" property and no
property definition at all within the file. In fact, I couldn't find any
example (google) having defined that property, which lead me to believe that
"classpath" (just like the <path> tag) is something legit in Ant and I just
couldn't find a description for.

I looked at the chapter again (
http://ant.apache.org/manual/using.html#path ) and don't see <path> tag
definition. The notion of path-like structure is clear. The fact that some
tasks (<typedef> <taskdef>) have "path" and/or "classpath" attributes is
clear. I haven't tried but I thing that path-like structures was meant as
datatype description for such attributes.

Am I correct or not?

Thanks

----- Original Message -----
From: "Erik Hatcher" <er...@ehatchersolutions.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Wednesday, December 31, 2003 11:43 AM
Subject: Re: <classpath> and <path> -


> On Dec 31, 2003, at 10:53 AM, DevKon wrote:
> >
> > Regarding <classpath> :
> >
> >> From the manual:
> >
> > ////
> >    <classpath>
> >       <pathelement path="${classpath}"/>
> >     </classpath>
> > ///
> >
> > What is ${classpath} referring to?
>
> It is an Ant property reference.
>
> >  Also, how do I get to print variables or properties
> > <echo>${classpath}/<echo> prints "${classpath}", how do I get the
> > actual value?
>
> In this case, the actual value is undefined, that is what it means when
> you see the property echo'd like that.  The Ant property has not been
> defined in the build file.
>
> > Regarding <path>:  what is <path> exactly - a type, a task etc.  I see
> > path definitions in various example scripts but haven't seen a formal
> > definition in the docs.
>
> <path> is a data type.  In the docs it is called a "path-like
> structure".  It is documented here:
> http://ant.apache.org/manual/using.html#path
>
> I haven't plugged our book in a long long time, but I just saw a nice
> mention of it in the blogworld today:
> <http://www.werner.be/blog/page/werner/
> 20031231#java_development_with_ant_good>
>
> I definitely recommend it for learning the Ant basics!  :)
>
> Erik
>
>
> ---------------------------------------------------------------------
> 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


Re: and -

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Dec 31, 2003, at 10:53 AM, DevKon wrote:
>
> Regarding <classpath> :
>
>> From the manual:
>
> ////
>    <classpath>
>       <pathelement path="${classpath}"/>
>     </classpath>
> ///
>
> What is ${classpath} referring to?

It is an Ant property reference.

>  Also, how do I get to print variables or properties  
> <echo>${classpath}/<echo> prints "${classpath}", how do I get the  
> actual value?

In this case, the actual value is undefined, that is what it means when  
you see the property echo'd like that.  The Ant property has not been  
defined in the build file.

> Regarding <path>:  what is <path> exactly - a type, a task etc.  I see  
> path definitions in various example scripts but haven't seen a formal  
> definition in the docs.

<path> is a data type.  In the docs it is called a "path-like  
structure".  It is documented here:  
http://ant.apache.org/manual/using.html#path

I haven't plugged our book in a long long time, but I just saw a nice  
mention of it in the blogworld today:  
<http://www.werner.be/blog/page/werner/ 
20031231#java_development_with_ant_good>

I definitely recommend it for learning the Ant basics!  :)

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: and -

Posted by Jim Fuller <ji...@ruminate.co.uk>.

> From: DevKon [mailto:devkon@rogers.com]
> Sent: 31 December 2003 15:53
> Subject: <classpath> and <path> -
 
> Regarding <classpath> :
 
> 
> ////
>    <classpath>
>       <pathelement path="${classpath}"/>
>     </classpath>
> ///
 
[Jim Fuller] which is understandably vague if there is no defined
<property/> named classpath.
 
> What is ${classpath} referring to? Also, how do I get to print
variables
> or properties <echo>${classpath}/<echo> prints "${classpath}", how do
I
> get the actual value?

[Jim Fuller] 


execute the following target, in whatever build ( or example build )
file and you will receive a list of system and ant built in properties. 

<target name="debug">
	<echoproperties/>
</target>

..normally the system classpath is java.class.path property that is
accessible by Ant.

Now you can print out the classpath value. <echo
message="${java.class.path}"/>. 

Though if you define classpaths that are dependent on the underlying JVM
or classpath system ENV variable you make your builds less portable e.g.
it is less likely that the build will work on another machine which may
have a differently configured system classpath...which is why we
use......

> Regarding <path>:  what is <path> exactly - a type, a task etc.  I see
> path definitions in various example scripts but haven't seen a formal
> definition in the docs.

Paths ( or path-like ) structures to define classpaths for java
dependent Ant tasks to use. Having an explicitly defined path statement
is much cleaner way.

Basically I have always called paths and classpaths a datatype, which
admittedly is a bit awkward vocab in terms of computing regular usage of
the term.

If you want to manipulate files and directories just stick with the
fileset datatype.

Happy new year, Jim Fuller

Ps: you can change Ant's default behavior on which classpath to use or
compose them together by setting a build.sysclasspath property.
Get the skinny here: http://ant.apache.org/manual/sysclasspath.html
 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org