Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs.optional.jlink

public Class JlinkTask

extends MatchingTask
Class Inheritance
Imports
java.io.File, org.apache.tools.ant.BuildException, .Project, org.apache.tools.ant.taskdefs.MatchingTask, org.apache.tools.ant.types.Path

This task defines objects that can link together various jar and zip files. It is not related to the 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>

Field Summary

Modifier and TypeField and Description
private Path
private boolean
private Path
private File
Inherited from org.apache.tools.ant.taskdefs.MatchingTask:
fileset

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Path

Returns:

a path to be configured
createAddfiles
()

Establishes the object that contains the files to be added to the output.

public Path

Returns:

a path to be configured
createMergefiles
()

Establishes the object that contains the files to be merged into the output.

public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Does the adding and merging.
private boolean
private boolean
private boolean
public void
setAddfiles(Path
a path
addfiles
)

Sets the files to be added into the output.

public void
setCompress(boolean
a boolean value
compress
)

Defines whether or not the output should be compacted.

public void
setMergefiles(Path
a path
mergefiles
)

Sets the files to be merged into the output.

public void
setOutfile(File
the output file
outfile
)

The output file for this run of jlink.

Inherited from org.apache.tools.ant.taskdefs.MatchingTask:
addaddAndaddContainsaddContainsRegexpaddCustomaddDateaddDependaddDepthaddDifferentaddFilenameaddMajorityaddModifiedaddNoneaddNotaddOraddPresentaddSelectoraddSizeaddTypeappendSelectorcreateExcludecreateExcludesFilecreateIncludecreateIncludesFilecreatePatternSetgetDirectoryScannergetImplicitFileSetgetSelectorshasSelectorsselectorCountselectorElementssetCaseSensitivesetDefaultexcludessetExcludessetExcludesfilesetFollowSymlinkssetIncludessetIncludesfilesetProjectXsetIgnoreXsetItems

Field Detail

addfilesback to summary
private Path addfiles
compressback to summary
private boolean compress
mergefilesback to summary
private Path mergefiles
outfileback to summary
private File outfile

Constructor Detail

JlinkTaskback to summary
public JlinkTask()

Method Detail

createAddfilesback to summary
public Path createAddfiles()

Establishes the object that contains the files to be added to the output.

Returns:Path

a path to be configured

createMergefilesback to summary
public Path createMergefiles()

Establishes the object that contains the files to be merged into the output.

Returns:Path

a path to be configured

executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

Does the adding and merging.

Annotations
@Override
Exceptions
BuildException:
on error
haveAddFilesback to summary
private boolean haveAddFiles()
haveEntriesback to summary
private boolean haveEntries(Path p)
haveMergeFilesback to summary
private boolean haveMergeFiles()
setAddfilesback to summary
public void setAddfiles(Path addfiles)

Sets the files to be added into the output.

Parameters
addfiles:Path

a path

setCompressback to summary
public void setCompress(boolean compress)

Defines whether or not the output should be compacted.

Parameters
compress:boolean

a boolean value

setMergefilesback to summary
public void setMergefiles(Path mergefiles)

Sets the files to be merged into the output.

Parameters
mergefiles:Path

a path

setOutfileback to summary
public void setOutfile(File outfile)

The output file for this run of jlink. Usually a jar or zip file.

Parameters
outfile:File

the output file