ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Kuperus Heun <>
Subject [PATCH] jlink task
Date Wed, 06 Sep 2000 20:51:11 GMT

This is my first contribution to ant.  I hope it is helpful to 
others.  Judging by recent posts, there may be some interest.  It may 
be helpful to consider merging (no pun intended) some of the 
functionality of jlink with the jar task or vice versa.  I'm open to 

I apologize for not providing diffs here: I don't have a means to 
generate those.  Sorry.

This task is based on code by Patrick Beard.


Links entries from sub-builds and libraries.

The jlink task can be used to build jar and zip files, similar to the 
jar task. However, jlink provides options for controlling the way 
entries from input files are added to the output file. Specifically, 
capabilities for merging entries from multiple zip or jar files is 

If a mergefile is specified directly (eg. at the top level of a 
mergefiles pathelement) and the mergefile ends in ".zip" or ".jar", 
entries in the mergefile will be merged into the outfile. A file with 
any other extension will be added to the output file, even if it is 
specified in the mergefiles element. Directories specified in either 
the mergefiles or addfiles element are added to the output file as 
you would expect: all files in subdirectories are recursively added 
to the output file with appropriate prefixes in the output file 
(without merging).

jlink will fail if duplicate entries are found in the mergefiles.

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

It is possible to refine the set of files that are being jlinked. 
This can be done with the includes, includesfile, excludes, 
excludesfile, and defaultexcludes attributes on the addfiles and 
mergefiles nested elements. With the includes or includesfile 
attribute you specify the files you want to have included by using 
patterns. The exclude or excludesfile attribute is used to specify 
the files you want to have excluded. This is also done with patterns. 
And finally with the defaultexcludes attribute, you can specify 
whether you want to use default exclusions or not. See the section on 
directory based tasks, on how the inclusion/exclusion of files works, 
and how to write patterns. The patterns are relative to the base 

The Details:

I have attached three .java files that provide the source code for 
jlink.  Also, I have attached a first cut at some html documentation 
for the task.

Comments and bug reports are welcome.


View raw message