ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Portier" <Marc.Port...@the-ecorp.com>
Subject RE: Jar updating?
Date Fri, 20 Apr 2001 07:22:47 GMT
there was a discussion on this recently:

- the main eye opener was that the <jar> task inherits from the <zip> task
and while documentation not always says so you have access to most (all?)
zip-features (defined asn ested elements and/or attributes) while using jar

- as for the thread itself, here are the main snippets:
[SNIP1]
>> Does the "jar" task have a functional equivalent of the "-u" option
>> to the command-line: "jar"? i didn't see reference to it in the docs
>> or the FAQ.
>
>Not directly, but you can fake it with <move> and nested <zipfileset>s
>- but I guess creating the jar from scratch would be faster.
[SNIP2]
>> Also the documentation seems to imply that <zipfileset> is only
>> valid for the <zip> task.
>
>and <jar> and <war> (and <ear> in 1.4alpha).  The docs need to be
>clarified.
>
> Could I ask you to please give us a brief example of how to add
> ./my/package/name/file.name to ./lib/myarchive.jar?
>
><move file="lib/myarchive.jar" tofile="lib/tmp.jar" />
><jar jarfile="lib/myarchive.jar" ... >
>  <fileset dir="." includes="my/package/name/file.name" />
>  <zipfileset src="lib/tmp.jar" includes="**" />
></jar>
><delete file="lib/tmp.jar" />
>
>...
>
>You get the idea
[END SNIPS]

- don't know how this would work in the 'replace' scenario though...
probably the order of defining your files in the set would be of importance?
(last or first in the list wins the (over)write-deal?)

- to be complete: next to the faq there is a very good mail archive at:
http://marc.theaimsgroup.com/?l=ant-user
(search for: "update jar")  you can check off quickly for ready, passed-by
answers for your new questions there

hope this helps,
and wishing you more fun...
-marc=


-----Original Message-----
From: Jon Skeet [mailto:jon.skeet@peramon.com]
Sent: donderdag 19 april 2001 19:59
To: ant-user@jakarta.apache.org
Subject: Jar updating?


Just for fun, I'm trying to convert our company's current
build procedure to use Ant. If it works, I'll move it over properly.
One of the things we do in a few places is add/replace files within a
jar. As far as I can see, the standard jar task is only capable of adding
files.
Firstly, is the above correct?
Secondly, if it is, does anyone else have a task which updates a jar file,
preferrably using a filespec etc? If not, I realise I can either unjar the
original, delete it, copy the new files over the top, then create the jar
again - but that's considerably more hassle :)
(I'd have looked in the FAQ for this, but the link on the main Ant page
is broken as far as I can see.)
Jon


Mime
View raw message