ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Don Ferguson <...@bea.com>
Subject [PATCH] Zip.java and friends
Date Mon, 15 Jan 2001 23:15:55 GMT
With these patches, Zip (and derivative tasks such as Jar and War) can
merge the entries of multiple zip files into a single output zip file.
The contents of an input zip file may be selectively extracted based on
include/exclude patterns.

An included zip file is specified using a <fileset> with a "src" attribute,
as in:

   <target name="jartest">
       <jar jarfile="utils.jar">
         <fileset
	  src="weblogic.jar"
	  includes="weblogic/utils/"
	  excludes="weblogic/utils/jars/,**/reflect/"
         />
        </jar>
    </target>

In this example, a subset of the "weblogic/utils" directory is extracted 
from weblogic.jar, into utils.jar.

The fileset may also contain "prefix" and "fullpath" attributes (the
functionality of PrefixedFileSet has been retained in the new class 
ZipFileSet).  Prefixes apply to directory-based and zip-based filesets.
The fullpath attributes applies only to a single file in a directory-based
fileset.

The War task may extract entries from a zip file for all of its filesets
(including the files in "classes" and "lib").


The motivation for this change is:
1) There is significant overlap between "jlink" and "zip", and it seemed
    better to combine them.
2) "jlink" does not support include/exclude patterns which are extremely
    useful for writing packaging-type tasks such as Zip/Jar/War.  This
    was my main motivation.
3) By adding this functionality to the base task, it can also be used in
    derivative tasks such as Jar and War.


This is my first submission jakarta-ant; I hope it is deemed worthy.


	-Don

Mime
View raw message