Here's how you can make your life easier. At the top of your build.xml
(outside any targets), specify this:
<patternset id="patternset-lib">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</patternset>
Then, inside <javac>, use this:
<classpath>
<fileset dir="${lib.dir}">
<patternset refid="patternset-lib"/>
</fileset>
</classpath>
With, of course, the lib.dir property set to your lib directory.
Erik
----- Original Message -----
From: "burtonator" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 24, 2001 6:47 PM
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 ( [EMAIL PROTECTED], [EMAIL PROTECTED],
[EMAIL PROTECTED] )
> 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-----
>