ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SimonRichards...@halifax.co.uk
Subject RE: Passed in $CLASSPATH versus javac classpath
Date Thu, 03 May 2001 07:40:19 GMT
David

We also use a wrapper to call ant, however the calls in our wrappers are in
the form
'ant -buildfile <buildfile> -logfile <logfile>'

Which on NT invokes ant.bat and on Solaris invokes the ant shell script.
The problem we encountered was that ant.bat and ant (shell) construct
LOCALCLASSAPATH in different ways.  Because of the problems this caused we
decided to build an application specific classpath (appcp) in the wrapper
and assign it to the classpath property in the javac task.  

	<target name="build" depends="init">
		<echo message="information: building ${src} into
${build}."/>
		<javac srcdir="${src}" 
			destdir="${build}" 
			classpath="${appcp}" 
			excludesfile="${apphome}\app.excludes.txt" 
			failonerror="no"/>
	</target>

The wrapper also sets CLASSPATH to include only the jars from
${ant_home}/lib.

This appears to work OK.

Simon

-----Original Message-----
From: David.Bailey@lawson.com [mailto:David.Bailey@lawson.com]
Sent: 02 May 2001 23:31
To: ant-user@jakarta.apache.org
Subject: Passed in $CLASSPATH versus javac classpath





I'm invoking ant with a wrapper script, which calls ant using

     '$JAVACMD -classpath $LOCALCLASSPATH $ANT_OPTS
org.apache.tools.ant.Main
$ENVOPTS $@'

It appears that whenever ant encounters a <javac> task, it uses the passed
in
$LOCALCLASSPATH instead of any path specified using the "classpath"
attribute of
the <javac> task.  Is this expected behavior?  Is there anything that can be
done (other than refraining from using the '-classpath' option in the
wrapper)
to make ant use the classpath specified in the <javac> task rather than the
one
passed via the '-classpath' option?

Thanks,

--dave



------------------------------------------------------------------------------
Part of the Halifax Group, Halifax plc, Registered in England No. 2367076.  Registered Office:
Trinity Road, Halifax, West Yorkshire HX1 2RG. Represents only the Halifax Financial Services
Marketing Group for the purposes of advising on and selling life assurance, pensions and unit
trust business.  The Marketing Group is regulated by the Personal Investment Authority.  Switchboard
01422 333333.


==============================================================================


Mime
View raw message