org.apache.tools.ant.taskdefs.optional.jlink

Class JlinkTask

public class JlinkTask extends MatchingTask

This class defines objects that can link together various jar and zip files.

It is basically a wrapper for the jlink code written originally by Patrick Beard. The classes org.apache.tools.ant.taskdefs.optional.jlink.Jlink and org.apache.tools.ant.taskdefs.optional.jlink.ClassNameReader support this class.

For example:

 <jlink compress="false" outfile="out.jar"/>
   <mergefiles>
     <pathelement path="${build.dir}/mergefoo.jar"/>
     <pathelement path="${build.dir}/mergebar.jar"/>
   </mergefiles>
   <addfiles>
     <pathelement path="${build.dir}/mac.jar"/>
     <pathelement path="${build.dir}/pc.zip"/>
   </addfiles>
 </jlink>
 

UNKNOWN: ignore="true"

Method Summary
PathcreateAddfiles()
Establishes the object that contains the files to be added to the output.
PathcreateMergefiles()
Establishes the object that contains the files to be merged into the output.
voidexecute()
Does the adding and merging.
voidsetAddfiles(Path addfiles)
Sets the files to be added into the output.
voidsetCompress(boolean compress)
Defines whether or not the output should be compacted.
voidsetMergefiles(Path mergefiles)
Sets the files to be merged into the output.
voidsetOutfile(File outfile)
The output file for this run of jlink.

Method Detail

createAddfiles

public Path createAddfiles()
Establishes the object that contains the files to be added to the output.

Returns: a path to be configured

createMergefiles

public Path createMergefiles()
Establishes the object that contains the files to be merged into the output.

Returns: a path to be configured

execute

public void execute()
Does the adding and merging.

Throws: BuildException on error

setAddfiles

public void setAddfiles(Path addfiles)
Sets the files to be added into the output.

Parameters: addfiles a path

setCompress

public void setCompress(boolean compress)
Defines whether or not the output should be compacted.

Parameters: compress a boolean value

setMergefiles

public void setMergefiles(Path mergefiles)
Sets the files to be merged into the output.

Parameters: mergefiles a path

setOutfile

public void setOutfile(File outfile)
The output file for this run of jlink. Usually a jar or zip file.

Parameters: outfile the output file