ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: How to update a jar?
Date Thu, 10 May 2001 10:56:36 GMT
Jon Skeet <jon.skeet@peramon.com> wrote:

>> It is all coded up, using java.util.zip classes in Ant 1.3 and
>> using a new org.apache.tools.zip package in Ant 1.4alpha.
> 
> Okay, that presumably makes it a right royal pain to attempt to
> write a patch to allow this (as a newbie when it comes to Ant
> development).

It depends on your experience.  If you know the java.util.zip classes,
its not that difficult (the new ones are an extension of ZipEntry and
a new implementation of ZipOutputSteam with an interface identical to
the standard one).

> It strikes me it would be useful to allow this for zip as well as
> jar, by the way.

Sure.  Jar is a child class of Zip, it just adds special treatment for
the manifest file, that's all.  All changes should happen for zip as
<jar>, <war> and <ear> would benefit from them immediately.

> There is one slight wrinkle, however: with the jar version I believe
> you'd want to exclude the original manifest from the list of files
> being added.

Could be specified by using patterns - maybe jar would optionally
exclude META-INF/MANIFEST.MF while war excludes WEB_INF/web.xml and so
on.

> Is there an easy way to effectively code up the bit of Ant XML
> within the zip (or jar) task,

take a look at the optional RenameExtension task in Ant 1.3, it simply
maps itself to an invocation of move under the covers.

> or would I be better off using the Java IO libraries directly for
> the move/delete operations?

I'd do so.

> Oh, and at what stage is this discussion best moved to the Dev list?

Four or five messages ago 8-)

Stefan

Mime
View raw message