Methods Summary |
---|
public org.apache.tools.ant.types.Path | createAddfiles()Establishes the object that contains the files to
be added to the output.
if (this.addfiles == null) {
this.addfiles = new Path(getProject());
}
return this.addfiles.createPath();
|
public org.apache.tools.ant.types.Path | createMergefiles()Establishes the object that contains the files to
be merged into the output.
if (this.mergefiles == null) {
this.mergefiles = new Path(getProject());
}
return this.mergefiles.createPath();
|
public void | execute()Does the adding and merging.
//Be sure everything has been set.
if (outfile == null) {
throw new BuildException("outfile attribute is required! "
+ "Please set.");
}
if (!haveAddFiles() && !haveMergeFiles()) {
throw new BuildException("addfiles or mergefiles required! "
+ "Please set.");
}
log("linking: " + outfile.getPath());
log("compression: " + compress, Project.MSG_VERBOSE);
jlink linker = new jlink();
linker.setOutfile(outfile.getPath());
linker.setCompression(compress);
if (haveMergeFiles()) {
log("merge files: " + mergefiles.toString(), Project.MSG_VERBOSE);
linker.addMergeFiles(mergefiles.list());
}
if (haveAddFiles()) {
log("add files: " + addfiles.toString(), Project.MSG_VERBOSE);
linker.addAddFiles(addfiles.list());
}
try {
linker.link();
} catch (Exception ex) {
throw new BuildException(ex, getLocation());
}
|
private boolean | haveAddFiles()
return haveEntries(addfiles);
|
private boolean | haveEntries(org.apache.tools.ant.types.Path p)
if (p == null) {
return false;
}
if (p.size() > 0) {
return true;
}
return false;
|
private boolean | haveMergeFiles()
return haveEntries(mergefiles);
|
public void | setAddfiles(org.apache.tools.ant.types.Path addfiles)Sets the files to be added into the output.
if (this.addfiles == null) {
this.addfiles = addfiles;
} else {
this.addfiles.append(addfiles);
}
|
public void | setCompress(boolean compress)Defines whether or not the output should be compacted.
this.compress = compress;
|
public void | setMergefiles(org.apache.tools.ant.types.Path mergefiles)Sets the files to be merged into the output.
if (this.mergefiles == null) {
this.mergefiles = mergefiles;
} else {
this.mergefiles.append(mergefiles);
}
|
public void | setOutfile(java.io.File outfile)The output file for this run of jlink. Usually a jar or zip file.
this.outfile = outfile;
|