> We have an ant build file that uses jlink to create a single
> jar of all the
> thirdparty jars we compile with (for deployment).
>
> The ant build file defines a thirdparty classpath as a series of path
> elements, this is referred to in both the javac and jlink tasks.
>
> I would like to switch to using the jar task however this
> means I have to
> define a fileset. If I use this for the basis of our classpath and our
> distribution jar then I can't control the order. This is
> important as some
> of the thirdparty jars we use contain common classes.
Ok, a path has an order. But if you have a single jar file - where
is the order? Do you have an order withing the jar created by jlink?
> Ideally I would like to define a filelist and use this as the
> basis for the
> classpath and the jar task, but I cannot see a way to create
> a jar from a fileset.
Use AntContribs <pathtofileset> :-)
<path id="thirdparty.classpath"> ... </path>
<pathtofileset
name="thirdparty.fileset"
dir="${lib.dir}"
pathrefid="thirdparty.classpath"
/>
<jar destfile="thirdparty.jar">
<fileset refid="thirdparty.fileset"/>
</jar>
Jan