ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <>
Subject Re: Newbie "Classpath" question.
Date Tue, 24 Apr 2001 21:25:27 GMT
----- Original Message ----- 
From: "David Scassa" <>
To: <>
Sent: Tuesday, April 24, 2001 11:04 PM
Subject: Newbie "Classpath" question.

> Is there a better "more clear" description on how to build a classpath
> dynamically and include the classpath reference from within the build.xml
> file?
> My impression is that you have to set your classpath from the cmd line in
> Win2K, then execute Ant. That would seem to me to be a little cumbersome.
> I'd like to be able to "scan" the src tree for any .jar files and then
> dynamically build the classpath with those .jar file paths appended.
> Is this possible with Ant?

Yes, you can for example use something like 

  <path id="classpath">
    <fileset dir="C:\mylibs">
      <include name="**/*.jar"/>

  <target name="compile">
    <javac srcdir="mySrc" destdir="myClasses">
      <classpath refid="classpath"/>

The above (escpecially the javac-task) may contain errors.


View raw message