ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Meade" <eme...@geekfarm.org>
Subject RE: how to make a classpath like "/java/lib/*.jar"? once for a multi javac task build file.
Date Thu, 26 Oct 2000 01:49:52 GMT
> -----Original Message-----
> From: Barrie Treloar [mailto:Barrie.Treloar@camtech.com.au]
> Sent: Wednesday, October 25, 2000 5:50 PM
> To: ant-user@jakarta.apache.org; emeade@geekfarm.org
> Subject: Re: how to make a classpath like "/java/lib/*.jar"? once for a
> multi javac task build file.
> 
> 
> On Wed, 25 Oct 2000, Erik Meade wrote:
> 
> > Nico posted this a while back when asked 'how to make a classpath like
> > "/java/lib/*.jar"?'
> > 
> > >     <javac  srcdir="${build.src}"
> > >             destdir="${build.classes}"
> > >             includes="**/*.java"
> > >             debug="off" optimize="on">
> > >       <classpath>
> > >         <fileset dir="${build.lib}">
> > >           <include name="**/*.jar" />
> > >         </fileset>
> > >         <fileset dir="${build.current}">
> > >           <include name="**/*.jar" />
> > >         </fileset>
> > >       </classpath>
> > >     </javac>
> > 
> > Does anyone know of a way to "do this" for the classpath in 
> such a way that
> > I don't
> > have to cut and past this into the 13 javac tasks in a build file?
> 
> You can do this:
> 
>        <!-- Include id attributes to fileset so they can be -->
>        <!-- xml pasted into other tags -->
> 
>        <classpath>
>          <fileset id="classpath.build.lib" dir="${build.lib}">
>            <include name="**/*.jar" />
>          </fileset>
>          <fileset id="classpath.build.current" dir="${build.current}">
>            <include name="**/*.jar" />
>          </fileset>
>        </classpath>
> 
> And then in another classpath declaration
> 
>        <classpath>
>          <fileset refid="classpath.build.lib" />
>          <fileset refid="classpath.build.current" />
>        </classpath>
> 
> Barrie Treloar

Good idea, and I hadn't thought of that, but... I still have to
copy and past that bottom bit all over the place... I guess what
I really want to be able to do is set my classpath in one place
and I would like for that one place to be in the build.xml.  I
have resorted to setting my classpath via script.

Erik

Mime
View raw message