ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phillips, Matthew" <Matthew.Phill...@dsto.defence.gov.au>
Subject RE: Automatically importing a directory of .jar files.
Date Wed, 25 Jul 2001 04:48:09 GMT
Try

  <path id="project.classpath">
    <pathelement path="classes" />

    <fileset dir="lib">
      <include name="*.jar" />
      <include name="*.zip" />
    </fileset>
  </path>

Then

    <javac srcdir="src" destdir="classes" includes="**/*.java">
      <classpath refid="project.classpath" />
    </javac>

Matthew.

Matthew.
--
matthew.phillips@dsto.defence.gov.au
 
Senior Software Engineer,
EVIS Group, Information Technology Division,
Defence Science and Technology Organisation.
 
> -----Original Message-----
> From: burtonator [mailto:burton@relativity.yi.org]
> Sent: Wednesday, 25 July 2001 11:17 AM
> To: ant-dev@jakarta.apache.org
> Subject: Automatically importing a directory of .jar files.
> 
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> Hey.
> 
> I want to make it easy for my projects to be downloaded and 
> built without any
> major CLASSPATH hacks.  I am putting all my .jar files into 
> PROJECT/lib but I am
> hving to manually add EACH .jar into the "classpath" 
> attribute on the javac
> task.
> 
> It would make sense to just do a
> 
> <import-classpath dir="../lib"/>
> 
> And then run javac like:
> 
> <javac classpath="${CLASSPATH}
> 
> The ImportClasspath taskdef would read all .jar files form 
> the given directory
> and add them to the classpath.
> 
> Doesn't this seem more "clean" than manually adding each 
> classpath entry?  Has
> anyone attempted a Taskdef like this?
> 
> Kevin
> 
> - -- 
> Kevin A. Burton ( burton@apache.org, burton@openprivacy.org, 
> burtonator@acm.org )
>         Cell: 408-910-6145 URL: http://relativity.yi.org ICQ: 
> 73488596 
> 
> Without enlightenment, there is only ignorance.
>   -- famous Zen Koan
> 
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.4 (GNU/Linux)
> Comment: Get my public key at: http://relativity.yi.org/pgpkey.txt
> 
> iD8DBQE7XiUaAwM6xb2dfE0RApgHAJ9tkzO2BxXH/xB0q8lF/j5ZscJrDwCeMsV8
> xOYiWLtQ5CYQD+9GN5XzBUI=
> =UJCP
> -----END PGP SIGNATURE-----
> 

Mime
View raw message