There is two problems here.
1) script and scriptdef do not support classpath entries.
2) a task that adds to ant's classpath may be needed.

There was some discussion about adding to ant's classpath a while ago:
http://marc.theaimsgroup.com/?l=ant-dev&m=108055794609605&w=2
and the corresponding bugzilla entry:
http://issues.apache.org/bugzilla/show_bug.cgi?id=28228

Peter

Ben Gill wrote:

The jar files are bsf.jar (apache BSF) and js.jar (rhino) ...

The trouble is, the scriptdef tag does not allow you to specify a
classpath...



P.S. You can placed them in ${user.home}/lib - no need


to write a wrapper.

This would require all users to copy the jar files into this dir (when
the jars are already sitting within the shared src tree)

P.P.S. If you sit on unix machine you can create an
alias for ant command:
alias ant="ant -lib your_lib_dir" - again no need to

This works fine for UNIX, but not for windows as well (of course a
windows .bat put in system32 would work, but why should all developers
have to take this step!!)...


I am surprised there is no way of over riding the default classpath from
within the ANT build.xml file (ie. As a CORE task).. I realise such a
task could encourage bad practice ...

Writing wrappers is a bit untidy really ... considering the jar files
are literally one dir away from my build.xml file, it seems strange that
I cannot tell ANT that it needs jar files x,y,z to execute target 'a'
...


I have seen the build.sysclasspath first property, but as I am unable to
specify classpath within scriptdef, or globally, so this is no good for
me either....




-----Original Message-----
From: Ivan Ivanov [mailto:[EMAIL PROTECTED] Sent: 18 October 2004 10:51
To: Ant Users List
Subject: Re: Appending to ANT classpath


What do you need these jar's for: if you have custom
ant tasks defined there you can use classpath related
attributes of <taskdef>; if you use them to start java
classes (from their main() method) or compile your
source code you can use classpath related attribute of
<java> and <javac>.

HTH Ivan
P.S. You can placed them in ${user.home}/lib - no need
to write a wrapper.
P.P.S. If you sit on unix machine you can create an
alias for ant command:
alias ant="ant -lib your_lib_dir" - again no need to
write a wrapper

--- Ben Gill <[EMAIL PROTECTED]> wrote:



Hi,



I have some optional jar's that I need in the
classpath for my build.xml
file to work.  I don't want to copy them to
ANT_HOME/lib for them to get
picked up, else all developers will need to copy
these files to that
dir.



How can I add these jar files to ANT's classpath
without:



1)       using -lib on the command line (involves
writing a wrapper, not
very tidy - wrapper needs to work on dos/unix etc..)

2)       writing an ant task to copy the jar files
to ANT_HOME/lib

3)       exporting CLASSPATH before running the ant
script...



Is there anyway of appending to the CLASSPATH from
within the build.xml
file itself?







_______________________________ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to