> From: Stefan Bodewig [mailto:[EMAIL PROTECTED]
> Because I think it is pretty unlikely that the jars already have the
> locations relative to each other they will have in the end when we
> create the jar. I assume that there will be a final "copy jars into a
> distribution location" in most situations. So we need the user's help
> to find the jars.
>
> This is the same reason why I didn't implement auto-discovery from the
> Class-Path at all.
Actually Stefan, in my particular case (applied to a few projects), I first
create the install layout by copying all the jars to their definitive
location, and then do I create the jar with the manifest Class-Path:
attribute to reference to them. I suspect this is the case of anyone
generating the Class-Path attribute dynamically, instead of maintaining it
by hand.
But your <indexjars> nested element seems very reasonable nonetheless. If I
wanted to index JARs (and classes/ dirs) I put in Class-Path, I could simply
ID the <classpath> in the example below, and reference it in <indexjars>.
BTW, I got tired of using <pathconvert> for deducing the classpath, and
created a custom task for it. Eventually I need to make these general
purpose tasks available somewhere... See usage below. --DD
<manifestclasspath property="jar.classpath"
jarfile="build/classpath.jar"
xmlns="antlib:com.lgc.buildmagic">
<classpath>
<!-- All the classes/ directories -->
<dirset dir="build/classes" includes="dsp-*" />
<!-- All the resources/ directories -->
<dirset dir="build/resources" includes="dsp-*">
<!-- Add only non-empty directories to the classpath -->
<present targetdir="build/resources" present="both">
<mapper type="regexp" from="(.*)" to="\1/com" />
</present>
</dirset>
</classpath>
</manifestclasspath>
<bm:echoproperty name="jar.classpath" ifTrue="${verbose}" />
<jar destfile="build/classpath.jar"
basedir="homes/dsinfra/config" includes="doesn't exist">
<manifest>
<attribute name="Class-Path" value="${jar.classpath}"/>
</manifest>
</jar>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]