ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brett Knights" <br...@knightsofthenet.com>
Subject RE: Classpath stored in a single position?
Date Thu, 06 Sep 2001 17:18:26 GMT
If that turns out not to be feasible you could also try using an xml entity:

your build.xml file:

<project>
<!DOCTYPE project [
<!ENTITY stdPath "file:///c:/ABI/stdPath.txt" >
]>

...

<path id="standard.class.path">
  &stdPath;
</path>

...

<javac
...
	classpathref="standard.class.path"/> <!-- uses classpathref instead of classpath -->


then create stdPath.txt as:
<pathelement location="l:/Java/build/"/>
<pathelement location="C:/ABI/arrays/lib/816classes12.zip"/>
<pathelement location="C:/ABI/arrays/lib/AppClasses.jar;/>
...


If you needed project specific paths you could use:
<path id="standard.class.path">
  &stdPath;
</path>

<path id="project.class.path">
	<path refid="standard.class.path"/> <!-- you could of course skip the reference
and put &stdPath; here -->
	<pathelement location="c:/ABI/APISpecV1.jar"/>
</path>


...

<javac
...
	classpathref="project.class.path"/>


HTH

> -----Original Message-----
> From: Troy Gould [mailto:troy@dooyoo.co.uk]
> Sent: Thursday, September 06, 2001 9:13 AM
> To: ant-user@jakarta.apache.org
> Subject: RE: Classpath stored in a single position?
> 
> 
> Try using filesets (a great feature of ant) for your classpath.  That
> way you don't have to add every single file.
> Would look something like this:
> 
>     <!-- set up the classpath -->
>     <path id="project.class.path">
>       <fileset dir="C:/ABI/arrays/lib/">
>         <include name="**/*.jar,**/*.zip"/>
>       </fileset>
>     </path>
> 
> This will include all zip and jar files in the directory
> C:/ABI/arrays/lib.  Not sure if you are suppose to put a comma or a
> space.  Can't remember.
> 
> then use the following for your classpath tag
> 		 <classpath refid="project.class.path"/>
> 
> Hope this helps in cleaning up for classpath problems.
> 
> 
> 
> -----Original Message-----
> From: Ralph Jocham [mailto:rjocham72@yahoo.com]
> Sent: 06 September 2001 16:48
> To: ant-user@jakarta.apache.org
> Subject: Classpath stored in a single position?
> 
> 
> Hi,
> in our project we do have a rather long classpath.
> Currently I have this build.xml file in each package
> folder. (see below) But the Classpath changes often,
> so I have to change each build.xml file in each
> folder.
> Is it possible to extract the classpath into a single
> position from where it is being picked up by the
> build.xml file. That way I just have to change the
> classpath only once.
> 
> TIA
> Ralph
> 
> <project name="Test" default="compile" basedir=".">
> 
>   <!-- set global properties for this build -->
>   <property name="src" value="."/>
>   <property name="build" value="L:/java/build"/>
> 
>   <target name="init">
>     <!-- Create the time stamp -->
>     <tstamp/>
>   </target>
> 
>   <target name="compile" depends="init">
>     <!-- Compile the java code from ${src} into
> ${build} -->
>     <javac srcdir="${src}"
>            destdir="${build}"
> 	   debug="on">
> 	   <include name="*.java"/>
> 	   <exclude name="test/**"/>
> 	   <classpath
> path="l:/Java/build/;C:/ABI/arrays/lib/816classes12.zip;C:/ABI
> /arrays/li
> b/AppClasses.jar;C:/ABI/arrays/lib/castor-0.9.2-xml.jar;C:/ABI
> /arrays/li
> b/classes12.zip;C:/ABI/arrays/lib/comm.jar;C:/ABI/arrays/lib/c
> orelib.jar
> ;C:/ABI/arrays/lib/crimson.jar;C:/ABI/arrays/lib/dta.jar;C:/AB
> I/arrays/l
> ib/fmprtl.zip;C:/ABI/arrays/lib/jai_codec.jar;C:/ABI/arrays/li
> b/jai_core
> .jar;C:/ABI/arrays/lib/jaxp.jar;C:/ABI/arrays/lib/log4j.jar;C:
> /ABI/array
> s/lib/mlibwrapper_jai.jar;C:/ABI/arrays/lib/nav.jar;C:/ABI/arr
> ays/lib/re
> qres.jar;C:/ABI/arrays/lib/rtc.jar;C:/ABI/arrays/lib/security.
> jar;C:/ABI
> /arrays/lib/sms.jar;C:/ABI/arrays/lib/Tools.jar;C:/ABI/arrays/
> lib/TOPLin
> k.jar;C:/ABI/arrays/lib/TOPLinkX.jar;C:/ABI/arrays/lib/xalan.j
> ar;C:/ABI/
> arrays/lib/xerces.jar;C:/JBoss-2.2.2/lib/jaas.jar;C:/JBoss-2.2
> .2/lib/jax
> p.jar;C:/JBoss-2.2.2/lib/jboss-jass.jar;C:/JBoss-2.2.2/lib/jdb
> c2_0-stdex
> t.jar;C:/JBoss-2.2.2/lib/jmxri.jar;C:/JBoss-2.2.2/lib/xml.jar;
> C:/JBoss-2
> .2.2/lib/ext/ab-jnpserver.jar;C:/JBoss-2.2.2/lib/ext/activatio
> n.jar;C:/J
> Boss-2.2.2/lib/ext/awt.jar;C:/JBoss-2.2.2/lib/ext/classes12.zi
> p;C:/JBoss
> -2.2.2/lib/ext/connector.jar;C:/JBoss-2.2.2/lib/ext/dynaserver
> .jar;C:/JB
> oss-2.2.2/lib/ext/ejb.jar;C:/JBoss-2.2.2/lib/ext/ejb2.jar;C:/J
> Boss-2.2.2
> /lib/ext/ejxeditor.jar;C:/JBoss-2.2.2/lib/ext/ejxejb.jar;C:/JB
> oss-2.2.2/
> lib/ext/ejxjaws.jar;C:/JBoss-2.2.2/lib/ext/ejxjboss.jar;C:/JBo
> ss-2.2.2/l
> ib/ext/exolabcore-0.1.jar;C:/JBoss-2.2.2/lib/ext/gnu-regexp-1.
> 0.8.jar;C:
> /JBoss-2.2.2/lib/ext/hsql.jar;C:/JBoss-2.2.2/lib/ext/idb.jar;C
> :/JBoss-2.
> 2.2/lib/ext/jboss.jar;C:/JBoss-2.2.2/lib/ext/jbosscx-0.2.jar;C
> :/JBoss-2.
> 2.2/lib/ext/jbossmq.jar;C:/JBoss-2.2.2/lib/ext/jbosssx.jar;C:/
> JBoss-2.2.
> 2/lib/ext/jdbm.jar;C:/JBoss-2.2.2/lib/ext/jetty-service.jar;C:
> /JBoss-2.2
> .2/lib/ext/jms.jar;C:/JBoss-2.2.2/lib/ext/jmxtools.jar;C:/JBos
> s-2.2.2/li
> b/ext/jndi.jar;C:/JBoss-2.2.2/lib/ext/jnpserver.jar;C:/JBoss-2
> .2.2/lib/e
> xt/jpl-util-0_5b.jar;C:/JBoss-2.2.2/lib/ext/jta-spec1_0_1.jar;
> C:/JBoss-2
> .2.2/lib/ext/log4j.jar;C:/JBoss-2.2.2/lib/ext/log4j-old.jar;C:
> /JBoss-2.2
> .2/lib/ext/mail.jar;C:/JBoss-2.2.2/lib/ext/minerva-1_0b3.jar;C
> :/JBoss-2.
> 2.2/lib/ext/openjms-client-patched-0.5.1.jar;C:/JBoss-2.2.2/li
> b/ext/open
> jms-patched-0.5.1.jar;C:/JBoss-2.2.2/lib/ext/openjms-pool.jar;
> C:/JBoss-2
> .2.2/lib/ext/openjms-rmi-patched-0.5.1.jar;C:/JBoss-2.2.2/lib/
> ext/tomcat
> -service.jar;C:/JBoss-2.2.2/lib/ext/crimson.jar"/>
>     </javac>
>   </target>
> </project>
> 
> 
Mime
View raw message