ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: generating manifest classpath
Date Tue, 12 Nov 2002 21:34:41 GMT
And since my head's kind of imploding from trying to figure schemas out,
here is a concrete example to give me a break: to (try to) avoid command
line limitations of cmd.exe, a single front-end empty jar is created with a
Class-Path: attribute in its manifest that references a bunch of other jars
moved to the all/ directory. (see, I can be nice once in a while ;-). --DD

    <!-- Use intermediate property with location attribute instead of
         using ${jar} directly to ensure <pathconvert> works fine... -->
    <property name="jar-dir" location="${jar}" />

    <!-- Same fileset of all JARs used in <lsync>
         and <pathconvert> tasks -->
    <fileset id="somejars" dir="${jar-dir}">
      <include name="*.jar" />
      <include name="*.zip" />
      <exclude name="*_test.jar" />
    </fileset>

    <!-- Create pseudo Infra's JAR(s) with appropriate
         Class-Path: attribute in its manifest to avoid
         command line limitations with long classpath -->
    <pathconvert property="someclasspath"
                 refid="somejars"
                 pathsep=" "
                 dirsep="/">
      <map from="${jar-dir}" to="all" />
    </pathconvert>

    <jar destfile="something.jar"
         basedir="somewhere">
      <manifest>
        <attribute name="Class-Path" value="${someclasspath}"/>
        <snip/>
      </manifest>
    </jar>

-----Original Message-----
From: Dominique Devienne [mailto:DDevienne@lgc.com] 
Sent: Tuesday, November 12, 2002 3:15 PM
To: 'Ant Users List'
Subject: RE: generating manifest classpath

This has been answered several times in the past. It goes along the same
lines I just described in a post within the last hour or so about EJB jars.
It's as simple as using a <fileset> and <pathconvert>, but not that simple
;-) You'll find full solutions I provided in the past in the archives. --DD

-----Original Message-----
From: Dean Hiller [mailto:dhiller@avaya.com] 
Sent: Tuesday, November 12, 2002 2:59 PM
To: ant-user@jakarta.apache.org
Subject: generating manifest classpath

I was trying to generate the classpath for the manifest file so it was made
up of my dist jar and all the jars in the lib directory.  For example, if
a.jar, b.jar are in my lib dir, and I generate dist.jar, I would like my
classpath to be "a.jar b.jar dist.jar".  I have tried many different tasks
in ant to generate this but alot of them give me the full path of the jar in
the lib directory which is not what I want.  I have tried PathConvert and
BaseName(I almost need a combination of the two).
Anybody have any other ideas on how to automatically generate my classpath?
thanks,
Dean

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message