ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: JAR index
Date Fri, 23 Apr 2004 14:12:13 GMT
> From: Stefan Bodewig []
> 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"
        <!-- 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" />
    <bm:echoproperty name="jar.classpath" ifTrue="${verbose}" />

    <jar destfile="build/classpath.jar"
         basedir="homes/dsinfra/config" includes="doesn't exist">
        <attribute name="Class-Path" value="${jar.classpath}"/>

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message