You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Jens v.P." <de...@jevopi.de> on 2001/12/20 18:08:37 UTC

Re[2]: Perforce Optional Tasks

Hello Marcus,

  it's as Andrew expected: you have defined classpath outside a task
element, where ant interprets it as a task ittself. Classpath can only
be defined inside some task (like javac, java, javadoc...).

  If you want to define classpath and use it several times, just replace
your <classpath> with <path id="classpath"> and use references in
further tasks. But in fact, I don't see where you're using classpath
again... Why did you define classpath where you've defined it?

Jens


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


Re: Re[2]: Perforce Optional Tasks

Posted by Diane Holt <ho...@yahoo.com>.
--- Marcus <ma...@criticalpointsoftware.com> wrote:
> So, it would look like this?
>     <path id="${CLASSPATH}">
>     </path>

Nope. The "id" for a path is just an identifier you can use to reference
it at other places in your build-file. The elements of the path are
specified using the nested <pathelement> tags.

In order to reference your environment CLASSPATH variable, you need to
read your environment in, using the <property environment="..."/> task,
where "..." is a prefix you want to assign (I think most people tend to
use "env"). Once that task is run, you can reference your environment
variables as properties by using the prefix you specified, a "." and the
env var name -- eg., ${env.CLASSPATH}.

So if you wanted to set a <path> that was equivalent to your env var
CLASSPATH, you'd need to do something like:

  <path id="CLASSPATH">
    <pathelement path="${env.CLASSPATH}"/>
  </path>

Then, wherever you wanted to reference that path, you'd do it using:
  refid="CLASSPATH"

Diane

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



__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

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


Re: Re[2]: Perforce Optional Tasks

Posted by Marcus <ma...@criticalpointsoftware.com>.
Jens,

I had cut this version down from my build.xml file as it was using the junit
features and I did not have time to do all the automation (junit, p4,
build,etc) I would like for our 1st release, so I just tired to do this in
an other file and will re-integrate later.

So, it would look like this?
    <path id="${CLASSPATH}">
    </path>


  <echo message="syncing"/>
      <p4Sync force="yes" view="//cpdev//main/src/..." />

thx
-mez

----- Original Message -----
From: "Jens v.P." <de...@jevopi.de>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Thursday, December 20, 2001 9:08 AM
Subject: Re[2]: Perforce Optional Tasks


> Hello Marcus,
>
>   it's as Andrew expected: you have defined classpath outside a task
> element, where ant interprets it as a task ittself. Classpath can only
> be defined inside some task (like javac, java, javadoc...).
>
>   If you want to define classpath and use it several times, just replace
> your <classpath> with <path id="classpath"> and use references in
> further tasks. But in fact, I don't see where you're using classpath
> again... Why did you define classpath where you've defined it?
>
> Jens
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


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