ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Paul Arzul)
Subject how to supply manifest information for a merged jar
Date Thu, 26 Oct 2000 09:09:10 GMT
On 11 Sep 2000, Stefan Bodewig wrote:

: >>>>> "PA" == Paul Arzul <> writes:
:  PA> if i following your reasoning, then if i create the static.jar
:  PA> before doing the build, it should update the jar?
: Well, maybe this is what it should do, but it doesn't - as you've
: already seen.
: The next version of Ant is going to have a <jlink> task (probably
: available from the next nightly build) that is supposed to be able to
: merge .jars (and add files to them).
: Stefan

hi **,

from the ant 1.2 jlink documentation:

jlink ignores META-INF directories in mergefiles.
Users should supply their own manifest information
for the output file. 

how do i supply my manifest information for the
output file - seeing as jlink ignores meta-inf
directories in merge files, and the jar task
cannot update jar files.

do i have to use the exec task to access jar
update functionality?

(jar -umf manifest.txt merge.jar)

* * *

around 50% of my build time is spent jar-ing
static library files. i was hoping to speed things
up by merging a successful build jar with a once
off created mammoth static jar.

i get as far as creating and merging jar files,
but adding my manifest information to the merged
jar is proving troublesome.

the following example runs successfully, but my
understanding fails at the touch task.

1. the touch tasks does not appear to modifiy the
   date/timestamp on manifest.txt (i'm running
   winnt 4.0sp6)

2. as a result of 1., the jar task appears
   uninterested in adding my manifest

if i manually touch manifest.txt, and just run the
last jar task again, it says (i'm running with
-debug) that it's creating an empty jar archive.
that is correct according to the whenempty
attribute documentation, but it overwrites my
careful created merged jar file.

any suggestions or is it back to exec?

- p

Ant version 1.2 compiled on October 24 2000
<?xml version="1.0"?>

<project name="Test" default="merge">
  <target name="merge">
    <jar jarfile="build.jar">
      <fileset dir="build" />
      <fileset dir="resource" />

        <pathelement path="lib/static.jar" />
        <pathelement path="build.jar" />

    <touch file="manifest.txt" />

    <jar jarfile="merge.jar" manifest="manifest.txt" />

Please send email to me using plain text only. :)

View raw message