<target name="foo" depends="init">
<ant antfile="build.xml" target="bar" >
<property name="property1" value="aaaaa" />
<property name="foo" value="baz" />
</ant>
</target>
<target name="bar" depends="init">
<echo message="prop is ${property1} ${foo}" />
</target>
| Modifier and Type | Class and Description |
|---|---|
| private static enum | |
| public static class | Ant.Reference
Helper class that implements the nested <reference> element of <ant> and <antcall>. |
| public static class | Ant.TargetElement
Helper class that implements the nested <target> element of <ant> and <antcall>. |
| Modifier and Type | Field and Description |
|---|---|
| private String | antFile
the build.xml file (can be absolute) in this case dir will be ignored |
| private File | dir
the basedir where is executed the build file |
| private static final FileUtils | |
| private boolean | inheritAll
should we inherit properties from the parent ? |
| private boolean | inheritRefs
should we inherit references from the parent ? |
| private Project | newProject
the temporary project created to run the build file |
| private PrintStream | out
The stream to which output is to be written. |
| private String | output
the output |
| private List | properties
the properties to pass to the new project |
| private List | propertySets
the sets of properties to pass to the new project |
| private List | references
the references to pass to the new project |
| private boolean | targetAttributeSet
whether the target attribute was specified |
| private List | targets
the targets to call on the new project |
| private boolean | useNativeBasedir
Whether the basedir of the new project should be the same one as it would be when running the build file directly - independent of dir and/or inheritAll settings. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | addAlmostAll(Map<?, ?>
properties props, Ant.Hashtable to copy to the
new project.the type of property to set (a plain Ant property, a
user property or an inherited property). typeCopies all properties from the given table to the new project - omitting those that have already been set in the new project as well as properties named basedir or ant.file. |
| public void | addConfiguredTarget(Ant.
the tTargetElement to add.Add a target to this Ant invocation. |
| public void | addPropertyset(PropertySet
PropertySet to add.Add a set of properties to pass to the new project. |
| public void | addReference(Ant.
Reference to add.Add a Reference element identifying a data type to carry over to the new project. |
| private void | |
| private void | copyReference(String
the reference id in the current project. oldKey, String the reference id in the new project. newKey)Try to clone and reconfigure the object referenced by oldkey in the parent project and add it to the new project with the key newkey. |
| public Property | |
| public void | |
| protected String | Returns: the name of the default fileGet the default build file name to use when launching the task. |
| protected Project | |
| public void | handleErrorFlush(String
The string to output. errorOutputToFlush)Overrides org. |
| public void | handleErrorOutput(String
The string to output. errorOutputToHandle)Overrides org. |
| public void | handleFlush(String
The string to output. toFlush)Overrides org. |
| public int | Returns: the number of bytes read.the buffer into which data is to be read. buffer, int the offset into the buffer at which data is stored. offset, int the amount of data to read. length)Overrides org. |
| public void | handleOutput(String
The string output to output. outputToHandle)Overrides org. |
| public void | |
| private void | initializeProject()
Attaches the build listeners of the current project to the new project, configures a possible logfile, transfers task and data-type definitions, transfers properties (either all or just the ones specified as user properties to the current project, depending on inheritall), transfers the input handler. |
| private void | overrideProperties()
Override the properties in the new project with the one explicitly defined as nested elements here. |
| private void | |
| public void | |
| public void | |
| public void | setInheritAll(boolean
if true pass all properties to the new Ant project. value)If true, pass all properties to the new Ant project. |
| public void | setInheritRefs(boolean
if true, pass all references to the new Ant project value)If true, pass all references to the new Ant project. |
| public void | |
| public void | |
| public void | setUseNativeBasedir(boolean
boolean b)Whether the basedir of the new project should be the same one as it would be when running the build file directly - independent of dir and/or inheritAll settings. |
| antFile | back to summary |
|---|---|
| private String antFile the build.xml file (can be absolute) in this case dir will be ignored | |
| dir | back to summary |
|---|---|
| private File dir the basedir where is executed the build file | |
| FILE_UTILS | back to summary |
|---|---|
| private static final FileUtils FILE_UTILS | |
| inheritAll | back to summary |
|---|---|
| private boolean inheritAll should we inherit properties from the parent ? | |
| inheritRefs | back to summary |
|---|---|
| private boolean inheritRefs should we inherit references from the parent ? | |
| newProject | back to summary |
|---|---|
| private Project newProject the temporary project created to run the build file | |
| out | back to summary |
|---|---|
| private PrintStream out The stream to which output is to be written. | |
| output | back to summary |
|---|---|
| private String output the output | |
| properties | back to summary |
|---|---|
| private List<Property> properties the properties to pass to the new project | |
| propertySets | back to summary |
|---|---|
| private List<PropertySet> propertySets the sets of properties to pass to the new project | |
| references | back to summary |
|---|---|
| private List<Ant. the references to pass to the new project | |
| targetAttributeSet | back to summary |
|---|---|
| private boolean targetAttributeSet whether the target attribute was specified | |
| targets | back to summary |
|---|---|
| private List<String> targets the targets to call on the new project | |
| useNativeBasedir | back to summary |
|---|---|
| private boolean useNativeBasedir Whether the basedir of the new project should be the same one as it would be when running the build file directly - independent of dir and/or inheritAll settings.
| |
| Ant | back to summary |
|---|---|
| public Ant() simple constructor | |
| Ant | back to summary |
|---|---|
| public Ant(Task owner) create a task bound to its creator
| |
| addAlmostAll | back to summary |
|---|---|
| private void addAlmostAll(Map<?, ?> props, Ant. Copies all properties from the given table to the new project - omitting those that have already been set in the new project as well as properties named basedir or ant.file.
| |
| addConfiguredTarget | back to summary |
|---|---|
| public void addConfiguredTarget(Ant. Add a target to this Ant invocation.
| |
| addPropertyset | back to summary |
|---|---|
| public void addPropertyset(PropertySet ps) Add a set of properties to pass to the new project.
| |
| addReference | back to summary |
|---|---|
| public void addReference(Ant. Add a Reference element identifying a data type to carry over to the new project. | |
| addReferences | back to summary |
|---|---|
| private void addReferences() throws BuildException Add the references explicitly defined as nested elements to the new project. Also copy over all references that don't override existing references in the new project if inheritrefs has been requested.
| |
| copyReference | back to summary |
|---|---|
| private void copyReference(String oldKey, String newKey) Try to clone and reconfigure the object referenced by oldkey in the parent project and add it to the new project with the key newkey. If we cannot clone it, copy the referenced object itself and keep our fingers crossed. | |
| createProperty | back to summary |
|---|---|
| public Property createProperty() Property to pass to the new project. The property is passed as a 'user property'.
| |
| execute | back to summary |
|---|---|
| public void execute() throws BuildException Overrides org. Do the execution.
| |
| getDefaultBuildFile | back to summary |
|---|---|
| protected String getDefaultBuildFile() Get the default build file name to use when launching the task. This function may be overridden by providers of custom ProjectHelper so they can easily implement their sublauncher.
| |
| getNewProject | back to summary |
|---|---|
| protected Project getNewProject() Get the (sub)-Project instance currently in use.
| |
| handleErrorFlush | back to summary |
|---|---|
| public void handleErrorFlush(String errorOutputToFlush) Overrides org. Handle error output. Send it the the new project if is present, otherwise call the super class.
| |
| handleErrorOutput | back to summary |
|---|---|
| public void handleErrorOutput(String errorOutputToHandle) Overrides org. Handle error output. Send it the the new project if is present, otherwise call the super class.
| |
| handleFlush | back to summary |
|---|---|
| public void handleFlush(String toFlush) Overrides org. Handles output. Send it the the new project if is present, otherwise call the super class.
| |
| handleInput | back to summary |
|---|---|
| public int handleInput(byte[] buffer, int offset, int length) throws IOException Overrides org. Handles input. Delegate to the created project, if present, otherwise call the super class.
| |
| handleOutput | back to summary |
|---|---|
| public void handleOutput(String outputToHandle) Overrides org. Handles output. Send it the the new project if is present, otherwise call the super class.
| |
| init | back to summary |
|---|---|
| public void init() Overrides org. Creates a Project instance for the project to call.
| |
| initializeProject | back to summary |
|---|---|
| private void initializeProject() Attaches the build listeners of the current project to the new project, configures a possible logfile, transfers task and data-type definitions, transfers properties (either all or just the ones specified as user properties to the current project, depending on inheritall), transfers the input handler. | |
| overrideProperties | back to summary |
|---|---|
| private void overrideProperties() throws BuildException Override the properties in the new project with the one explicitly defined as nested elements here.
| |
| reinit | back to summary |
|---|---|
| private void reinit() Called in execute or createProperty (via getNewProject()) if newProject is null. This can happen if the same instance of this task is run twice as newProject is set to null at the end of execute (to save memory and help the GC). calls init() again | |
| setAntfile | back to summary |
|---|---|
| public void setAntfile(String antFile) The build file to use. Defaults to "build.xml". This file is expected to be a filename relative to the dir attribute given.
| |
| setDir | back to summary |
|---|---|
| public void setDir(File dir) The directory to use as a base directory for the new Ant project. Defaults to the current project's basedir, unless inheritall has been set to false, in which case it doesn't have a default value. This will override the basedir setting of the called project.
| |
| setInheritAll | back to summary |
|---|---|
| public void setInheritAll(boolean value) If true, pass all properties to the new Ant project. Defaults to true.
| |
| setInheritRefs | back to summary |
|---|---|
| public void setInheritRefs(boolean value) If true, pass all references to the new Ant project. Defaults to false.
| |
| setOutput | back to summary |
|---|---|
| public void setOutput(String outputFile) Set the filename to write the output to. This is relative to the value of the dir attribute if it has been set or to the base directory of the current project otherwise.
| |
| setTarget | back to summary |
|---|---|
| public void setTarget(String targetToAdd) The target of the new Ant project to execute. Defaults to the new project's default target.
| |
| setUseNativeBasedir | back to summary |
|---|---|
| public void setUseNativeBasedir(boolean b) Whether the basedir of the new project should be the same one as it would be when running the build file directly - independent of dir and/or inheritAll settings.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final Ant. | |
| public static final Ant. | |
| public static final Ant. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Ant. | |
| public static Ant. |
| INHERITED | back to summary |
|---|---|
| public static final Ant. | |
| PLAIN | back to summary |
|---|---|
| public static final Ant. | |
| USER | back to summary |
|---|---|
| public static final Ant. | |
| PropertyType | back to summary |
|---|---|
| private PropertyType() | |
| valueOf | back to summary |
|---|---|
| public static Ant. | |
| values | back to summary |
|---|---|
| public static Ant. | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: the id of the reference in the new project.Get the id under which this reference will be stored in the new project. |
| public void | setToRefid(String
the id under which this reference will be passed to
the new project. targetid)Set the id that this reference to be stored under in the new project. |
| targetid | back to summary |
|---|---|
| private String targetid | |
| Reference | back to summary |
|---|---|
| public Reference() | |
| getToRefid | back to summary |
|---|---|
| public String getToRefid() Get the id under which this reference will be stored in the new project.
| |
| setToRefid | back to summary |
|---|---|
| public void setToRefid(String targetid) Set the id that this reference to be stored under in the new project.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public void |
| name | back to summary |
|---|---|
| private String name | |
| TargetElement | back to summary |
|---|---|
| public TargetElement() Default constructor. | |
| getName | back to summary |
|---|---|
| public String getName() Get the name of this TargetElement.
| |
| setName | back to summary |
|---|---|
| public void setName(String name) Set the name of this TargetElement.
| |