ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <n...@apache.org>
Subject Re: auto-building a classpath
Date Sat, 10 Mar 2001 21:36:18 GMT
----- Original Message -----
From: "Will Hartung" <willh@msoft.com>
To: <ant-user@jakarta.apache.org>
Sent: Saturday, March 10, 2001 10:07 PM
Subject: auto-building a classpath


> Hi all,
>
> I'm curious if there is a way to automatically create a classpath.
>
> Specifically, we have a directory that we like to put all of our 3rd party
> jars into for the build, and I was wondering if there is some way that ANT
> can "look" at the directory, and just add all of the jars to the
classpath.
>

Yes, simply add

      <classpath>
        <fileset dir="myLibDir">
          <include name="**/*.jar" />
        </fileset>
      </classpath>

to your javac-task. You will get something like this:

    <javac  srcdir="src"
            destdir="classes"
            debug="off" optimize="on">
      <classpath>
        <fileset dir="${build.lib}">
          <include name="**/*.jar" />
        </fileset>
      </classpath>
    </javac>

As an alternative you can define the classpath as path on the project level,
add an 'id="myClasspath"' to the path and use it as "<classpath
refid="myClasspath"/> in every javac-task.

Nico



Mime
View raw message