|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.ProjectComponent | +--org.apache.tools.ant.Task | +--org.apache.tools.ant.taskdefs.SubAnt
Calls a given target for all defined sub-builds. This is an extension of ant for bulk project execution.
subant can be used with directory sets to execute a build from different directories. 2 different options are offered
Field Summary |
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
SubAnt()
|
Method Summary | |
void |
addDirset(DirSet set)
Adds a directory set to the implicit build path. |
void |
addFilelist(FileList list)
Adds an ordered file list to the implicit build path. |
void |
addFileset(FileSet set)
Adds a file set to the implicit build path. |
void |
addProperty(Property p)
Corresponds to <ant> 's
nested <property> element. |
void |
addPropertyset(PropertySet ps)
Corresponds to <ant> 's
nested <propertyset> element. |
void |
addReference(Ant.Reference r)
Corresponds to <ant> 's
nested <reference> element. |
Path |
createBuildpath()
Creates a nested build path, and add it to the implicit build path. |
Path.PathElement |
createBuildpathElement()
Creates a nested <buildpathelement> ,
and add it to the implicit build path. |
void |
execute()
Runs the various sub-builds. |
void |
handleErrorFlush(java.lang.String output)
Pass output sent to System.err to the new project. |
void |
handleErrorOutput(java.lang.String output)
Pass output sent to System.err to the new project. |
void |
handleFlush(java.lang.String output)
Pass output sent to System.out to the new project. |
int |
handleInput(byte[] buffer,
int offset,
int length)
Process input into the ant task |
void |
handleOutput(java.lang.String output)
Pass output sent to System.out to the new project. |
void |
setAntfile(java.lang.String antfile)
This method builds the file name to use in conjunction with directories. |
void |
setBuildpath(Path s)
Set the buildpath to be used to find sub-projects. |
void |
setBuildpathRef(Reference r)
Buildpath to use, by reference. |
void |
setFailonerror(boolean failOnError)
Sets whether to fail with a build exception on error, or go on. |
void |
setGenericAntfile(java.io.File afile)
This method builds a file path to use in conjunction with directories. |
void |
setInheritall(boolean b)
Corresponds to <ant> 's
inheritall attribute. |
void |
setInheritrefs(boolean b)
Corresponds to <ant> 's
inheritrefs attribute. |
void |
setOutput(java.lang.String s)
Corresponds to <ant> 's
output attribute. |
void |
setTarget(java.lang.String target)
The target to call on the different sub-builds. |
void |
setVerbose(boolean on)
Enable/ disable verbose log messages showing when each sub-build path is entered/ exited. |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, setProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SubAnt()
Method Detail |
public void handleOutput(java.lang.String output)
handleOutput
in class Task
output
- a line of outputpublic int handleInput(byte[] buffer, int offset, int length) throws java.io.IOException
handleInput
in class Task
buffer
- the buffer into which data is to be read.offset
- the offset into the buffer at which data is stored.length
- the amount of data to read
java.io.IOException
- if the data cannot be readTask.handleInput(byte[], int, int)
public void handleFlush(java.lang.String output)
handleFlush
in class Task
output
- The output to log. Should not be null
.public void handleErrorOutput(java.lang.String output)
handleErrorOutput
in class Task
output
- The error output to log. Should not be null
.public void handleErrorFlush(java.lang.String output)
handleErrorFlush
in class Task
output
- The error output to log. Should not be null
.public void execute()
execute
in class Task
public void setAntfile(java.lang.String antfile)
Defaults to "build.xml".
If genericantfile
is set, this attribute is ignored.
antfile
- the short build file name. Defaults to "build.xml".public void setGenericAntfile(java.io.File afile)
Use genericantfile
, in order to run the same build file
with different basedirs.
antfile
is ignored.
afile
- (path of the generic ant file, absolute or relative to
project base directory)public void setFailonerror(boolean failOnError)
failOnError
- the new value for this boolean flag.public void setTarget(java.lang.String target)
target
- the target
public void setVerbose(boolean on)
on
- true to enable verbose mode, false otherwise (default).public void setOutput(java.lang.String s)
<ant>
's
output
attribute.
s
- the filename to write the output to.public void setInheritall(boolean b)
<ant>
's
inheritall
attribute.
b
- the new value for this boolean flag.public void setInheritrefs(boolean b)
<ant>
's
inheritrefs
attribute.
b
- the new value for this boolean flag.public void addProperty(Property p)
<ant>
's
nested <property>
element.
p
- the property to pass on explicitly to the sub-build.public void addReference(Ant.Reference r)
<ant>
's
nested <reference>
element.
r
- the reference to pass on explicitly to the sub-build.public void addPropertyset(PropertySet ps)
<ant>
's
nested <propertyset>
element.
ps
- the propertsetpublic void addDirset(DirSet set)
Note that the directories will be added to the build path in no particular order, so if order is significant, one should use a file list instead!
set
- the directory set to add.public void addFileset(FileSet set)
Note that the directories will be added to the build path in no particular order, so if order is significant, one should use a file list instead!
set
- the file set to add.public void addFilelist(FileList list)
Note that contrary to file and directory sets, file lists can reference non-existent files or directories!
list
- the file list to add.public void setBuildpath(Path s)
s
- an Ant Path object containing the buildpath.public Path createBuildpath()
public Path.PathElement createBuildpathElement()
<buildpathelement>
,
and add it to the implicit build path.
public void setBuildpathRef(Reference r)
r
- a reference to an Ant Path object containing the buildpath.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |