|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
gate.util.ant.packager.PackageGappTask
public class PackageGappTask
Ant task to copy a gapp file, rewriting any relative paths it contains to point within the same directory as the target file location and copy the referenced files into the right locations. The resulting structure is self-contained and can be packaged up (e.g. in a zip file) to send to a third party.
| Nested Class Summary | |
|---|---|
class |
PackageGappTask.MappingHint
Class to represent a nested hint element. |
static class |
PackageGappTask.UnresolvedAction
Enumeration of the actions to take when there are unresolved resources. |
| Field Summary | |
|---|---|
private boolean |
copyPlugins
Should we copy the complete contents of referenced plugin directories into the right place relative to the destFile? |
private boolean |
copyResourceDirs
Should we copy the complete contents of the parent directories of any referenced resource files? |
private File |
destFile
The file into which the modified gapp will be written. |
private List<org.apache.tools.ant.types.Path> |
extraResourcesPaths
Path-like structure listing extra resources that should be packaged with the gapp, as if they had been referenced by relpaths from within the gapp file. |
private File |
gateHome
The location of the GATE home directory. |
private List<PackageGappTask.MappingHint> |
hintTasks
List of mapping hint sub-elements. |
private Map<URL,String> |
mappingHints
Map of mapping hints. |
private PackageGappTask.UnresolvedAction |
onUnresolved
The action to take when there are unresolved resources. |
static Comparator<URL> |
PATH_COMPARATOR
Comparator to compare URLs by lexicographic ordering of their getPath() values. |
private File |
src
The original file containing the gapp to package. |
| Fields inherited from class org.apache.tools.ant.Task |
|---|
target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
description, location, project |
| Constructor Summary | |
|---|---|
PackageGappTask()
|
|
| Method Summary | |
|---|---|
void |
addExtraResourcesPath(org.apache.tools.ant.types.Path path)
Add a path containing extra resources that should be treated as if they had been referenced by relpaths within the gapp file. |
private void |
copyDirectories(Map<URL,URL> copyMap,
boolean minimalPlugin)
Copy directories as specified by the given map. |
PackageGappTask.MappingHint |
createHint()
Create and add the representation for a nested <hint from="X" to="Y" /> element. |
void |
execute()
|
File |
getDestFile()
Get the destination file to which the modified gapp will be written. |
File |
getGateHome()
Get the location of the GATE home directory, used to resolve $gatehome$ relative paths in the GAPP file. |
private Set<String> |
getJars(URL creoleXml)
Extract the text values from any <JAR> elements contained in the referenced creole.xml file. |
PackageGappTask.UnresolvedAction |
getOnUnresolved()
Get the action performed when there are unresolved resources. |
File |
getSrc()
Get the original gapp file that is to be modified. |
private URL |
getUnresolvedResourcesTarget(TreeMap<URL,URL> unresolvedResourcesSubDirs,
URL unresolvedResourcesDir,
URL resourceDir)
Get a URL for a directory to which the given (unresolved) resource directory should be mapped. |
boolean |
isCopyPlugins()
Will the task copy the complete contents of referenced plugins into the target location? |
boolean |
isCopyResourceDirs()
Will the task copy the complete contents of directories containing referenced resources into the target location or just the referenced resources themselves? |
private void |
processExtraResourcesPaths(Set<URL> resources)
Process any extraresourcespath elements provided to this task and include the resources they refer to in the given set. |
void |
setCopyPlugins(boolean copyPlugins)
Will the task copy the complete contents of referenced plugins into the target location? |
void |
setCopyResourceDirs(boolean copyResourceDirs)
Will the task copy the complete contents of directories containing referenced resources into the target location? |
void |
setDestFile(File destFile)
Set the destination file to which the modified gapp will be written. |
void |
setGateHome(File gateHome)
Set the location of the GATE home directory, used to resolve $gatehome$ relative paths in the GAPP file. |
void |
setOnUnresolved(PackageGappTask.UnresolvedAction onUnresolved)
What should we do if there are unresolved relpaths within the gapp file? |
void |
setSrc(File src)
Set the location of the original gapp file which is to be modified. |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Comparator<URL> PATH_COMPARATOR
null compares less-than anything
not null.
private File destFile
private File src
private File gateHome
private boolean copyPlugins
private boolean copyResourceDirs
f we will also include
the whole contents of f.getParentFile().
private List<org.apache.tools.ant.types.Path> extraResourcesPaths
private PackageGappTask.UnresolvedAction onUnresolved
private List<PackageGappTask.MappingHint> hintTasks
private Map<URL,String> mappingHints
| Constructor Detail |
|---|
public PackageGappTask()
| Method Detail |
|---|
public File getDestFile()
public void setDestFile(File destFile)
public File getSrc()
public void setSrc(File src)
public File getGateHome()
public void setGateHome(File gateHome)
public boolean isCopyPlugins()
public void setCopyPlugins(boolean copyPlugins)
public boolean isCopyResourceDirs()
public void setCopyResourceDirs(boolean copyResourceDirs)
.def
file defining gazetteer lists, the lists themselves will not be
included. If copyResourceDirs is false, the additional resources
will need to be included using an appropriate
<extraresourcespath>.
public PackageGappTask.UnresolvedAction getOnUnresolved()
public void setOnUnresolved(PackageGappTask.UnresolvedAction onUnresolved)
public PackageGappTask.MappingHint createHint()
public void addExtraResourcesPath(org.apache.tools.ant.types.Path path)
public void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildExceptionprivate void processExtraResourcesPaths(Set<URL> resources)
private void copyDirectories(Map<URL,URL> copyMap,
boolean minimalPlugin)
copyMap - map specifying the directories to copy and the
target locations to which they should be copied.minimalPlugin - if true, treat the directory as a GATE plugin
and copy just the minimal files needed for the plugin to
work (creole.xml and any referenced jars).private Set<String> getJars(URL creoleXml)
private URL getUnresolvedResourcesTarget(TreeMap<URL,URL> unresolvedResourcesSubDirs,
URL unresolvedResourcesDir,
URL resourceDir)
throws org.apache.tools.ant.BuildException
unresolvedResourcesSubDirs - a map from URLs of directories
containing unresolved resources to the URLs under the
target unresolved-resources directory that they will be
mapped to. This map is updated by this method.unresolvedResourcesDir - the top-level application-resources
directory in the target location.resourceDir - a directory containing an unresolved resource.
org.apache.tools.ant.BuildException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||