ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <n...@apache.org>
Subject Re: Newbie "Classpath" question.
Date Tue, 24 Apr 2001 21:25:27 GMT
----- Original Message ----- 
From: "David Scassa" <dscassa@journee.com>
To: <ant-user@jakarta.apache.org>
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 

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

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

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

Nico



Mime
View raw message