jlink tool present in
Java 9 and later; for that, see
org.apache.tools.ant.taskdefs.modules.Link .
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>
| Modifier and Type | Field and Description |
|---|---|
| private Path | |
| private boolean | |
| private Path | |
| private File |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Path | Returns: a path to be configuredEstablishes the object that contains the files to be added to the output. |
| public Path | Returns: a path to be configuredEstablishes the object that contains the files to be merged into the output. |
| public void | |
| private boolean | |
| private boolean | |
| private boolean | |
| public void | |
| public void | |
| public void | |
| public void |
| addfiles | back to summary |
|---|---|
| private Path addfiles | |
| compress | back to summary |
|---|---|
| private boolean compress | |
| mergefiles | back to summary |
|---|---|
| private Path mergefiles | |
| outfile | back to summary |
|---|---|
| private File outfile | |
| JlinkTask | back to summary |
|---|---|
| public JlinkTask() | |
| createAddfiles | back to summary |
|---|---|
| public Path createAddfiles() Establishes the object that contains the files to be added to the output.
| |
| createMergefiles | back to summary |
|---|---|
| public Path createMergefiles() Establishes the object that contains the files to be merged into the output.
| |
| execute | back to summary |
|---|---|
| public void execute() throws BuildException Overrides org. Does the adding and merging.
| |
| haveAddFiles | back to summary |
|---|---|
| private boolean haveAddFiles() | |
| haveEntries | back to summary |
|---|---|
| private boolean haveEntries(Path p) | |
| haveMergeFiles | back to summary |
|---|---|
| private boolean haveMergeFiles() | |
| setAddfiles | back to summary |
|---|---|
| public void setAddfiles(Path addfiles) Sets the files to be added into the output.
| |
| setCompress | back to summary |
|---|---|
| public void setCompress(boolean compress) Defines whether or not the output should be compacted.
| |
| setMergefiles | back to summary |
|---|---|
| public void setMergefiles(Path mergefiles) Sets the files to be merged into the output.
| |
| setOutfile | back to summary |
|---|---|
| public void setOutfile(File outfile) The output file for this run of jlink. Usually a jar or zip file.
| |