If you are creating Targets programmatically, make sure you set the Location to a useful value. In particular all targets should have different location values.
Modifier and Type | Field and Description |
---|---|
private List | children
Children of this target (tasks and data types). |
private List | dependencies
List of targets this target is dependent on. |
private String | description
Description of this target, if any. |
private Condition | |
private String | ifString
The "if" condition to test on execution. |
private Location | location
Since Ant 1.6.2 |
private String | name
Name of this target. |
private Project | project
Project this target belongs to. |
private Condition | |
private String | unlessString
The "unless" condition to test on execution. |
Access | Constructor and Description |
---|---|
public | |
public |
Modifier and Type | Method and Description |
---|---|
public void | addDataType(RuntimeConfigurable
The wrapper for the data type element to be added.
Must not be r)null .Adds the wrapper for a data type element to this target. |
public void | addDependency(String
The name of a target this target is dependent on.
Must not be dependency)null .Adds a dependency to this target. |
public void | addTask(Task
The task to be added. Must not be task)null .Implements org. |
public boolean | |
public void | |
public Enumeration | Returns: an enumeration of the dependencies of this target (enumeration of String)Returns an enumeration of the dependencies of this target. |
public String | Returns: the description of this target, ornull if no
description is available.Returns the description of this target. |
public String | Returns: the "if" property condition ornull if no
"if" condition had been defined.Returns the "if" property condition of this target. |
public Location | |
public String | Returns: the name of this target, ornull if the
name has not been set yet.Returns the name of this target. |
public Project | Returns: The project this target belongs to, ornull if
the project has not been set yet.Returns the project this target belongs to. |
public Task[] | Returns: an array of the tasks currently within this targetReturns the current set of tasks to be executed by this target. |
public String | Returns: the "unless" property condition ornull
if no "unless" condition had been defined.Returns the "unless" property condition of this target. |
public static List | |
public final void | performTasks()
Performs the tasks within this target (if the conditions are met), firing target started/target finished messages around a call to execute. |
pack-priv void | replaceChild(Task
The task to replace.
Must not be el, RuntimeConfigurable null .The data type wrapper to replace o)el with.Replaces all occurrences of the given task in the list of children with the replacement data type wrapper. |
pack-priv void | replaceChild(Task
The task to replace.
Must not be el, Task null .The task to replace o)el with.Replaces all occurrences of the given task in the list of children with the replacement task. |
public void | setDepends(String
A comma-separated list of targets this target
depends on. Must not be depS)null .Sets the list of targets this target is dependent on. |
public void | setDescription(String
The description for this target.
May be description)null , indicating that no
description is available.Sets the description of this target. |
public void | |
public void | |
public void | |
public void | |
public void | setProject(Project
The project this target belongs to.
Must not be project)null .Sets the project this target belongs to. |
public void | |
public void | |
public String | Returns: the name of this target, ornull if the
name has not been set yet.Overrides java. |
children | back to summary |
---|---|
private List<Object> children Children of this target (tasks and data types). |
dependencies | back to summary |
---|---|
private List<String> dependencies List of targets this target is dependent on. |
description | back to summary |
---|---|
private String description Description of this target, if any. |
ifCondition | back to summary |
---|---|
private Condition ifCondition |
ifString | back to summary |
---|---|
private String ifString The "if" condition to test on execution. |
location | back to summary |
---|---|
private Location location Since Ant 1.6.2 |
name | back to summary |
---|---|
private String name Name of this target. |
project | back to summary |
---|---|
private Project project Project this target belongs to. |
unlessCondition | back to summary |
---|---|
private Condition unlessCondition |
unlessString | back to summary |
---|---|
private String unlessString The "unless" condition to test on execution. |
Target | back to summary |
---|---|
public Target() Default constructor. |
Target | back to summary |
---|---|
public Target(Target other) Cloning constructor.
|
addDataType | back to summary |
---|---|
public void addDataType(RuntimeConfigurable r) Adds the wrapper for a data type element to this target.
|
addDependency | back to summary |
---|---|
public void addDependency(String dependency) Adds a dependency to this target.
|
addTask | back to summary |
---|---|
public void addTask(Task task) Implements org. Adds a task to this target.
|
dependsOn | back to summary |
---|---|
public boolean dependsOn(String other) Does this target depend on the named target?
|
execute | back to summary |
---|---|
public void execute() throws BuildException Executes the target if the "if" and "unless" conditions are satisfied. Dependency checking should be done before calling this method, as it does no checking of its own. If either the "if" or "unless" test prevents this target from being executed, a verbose message is logged giving the reason. It is recommended that clients of this class call performTasks rather than this method so that appropriate build events are fired.
|
getDependencies | back to summary |
---|---|
public Enumeration Returns an enumeration of the dependencies of this target.
|
getDescription | back to summary |
---|---|
public String getDescription() Returns the description of this target.
|
getIf | back to summary |
---|---|
public String getIf() Returns the "if" property condition of this target.
|
getLocation | back to summary |
---|---|
public Location getLocation() Get the location of this target's definition.
|
getName | back to summary |
---|---|
public String getName() Returns the name of this target.
|
getProject | back to summary |
---|---|
public Project getProject() Returns the project this target belongs to.
|
getTasks | back to summary |
---|---|
public Task[] getTasks() Returns the current set of tasks to be executed by this target.
|
getUnless | back to summary |
---|---|
public String getUnless() Returns the "unless" property condition of this target.
|
parseDepends | back to summary |
---|---|
public static List |
performTasks | back to summary |
---|---|
public final void performTasks() Performs the tasks within this target (if the conditions are met), firing target started/target finished messages around a call to execute.
|
replaceChild | back to summary |
---|---|
pack-priv void replaceChild(Task el, RuntimeConfigurable o) Replaces all occurrences of the given task in the list of children with the replacement data type wrapper.
|
replaceChild | back to summary |
---|---|
pack-priv void replaceChild(Task el, Task o) Replaces all occurrences of the given task in the list of children with the replacement task. |
setDepends | back to summary |
---|---|
public void setDepends(String depS) Sets the list of targets this target is dependent on. The targets themselves are not resolved at this time.
|
setDescription | back to summary |
---|---|
public void setDescription(String description) Sets the description of this target.
|
setIf | back to summary |
---|---|
public void setIf(String property) Sets the "if" condition to test on execution. This is the
name of a property to test for existence - if the property
is not set, the task will not execute. The property goes
through property substitution once before testing, so if
property
|
setIf | back to summary |
---|---|
public void setIf(Condition condition) Same as
|
setLocation | back to summary |
---|---|
public void setLocation(Location location) Sets the location of this target's definition.
|
setName | back to summary |
---|---|
public void setName(String name) Sets the name of this target.
|
setProject | back to summary |
---|---|
public void setProject(Project project) Sets the project this target belongs to.
|
setUnless | back to summary |
---|---|
public void setUnless(String property) Sets the "unless" condition to test on execution. This is the
name of a property to test for existence - if the property
is set, the task will not execute. The property goes
through property substitution once before testing, so if
property
|
setUnless | back to summary |
---|---|
public void setUnless(Condition condition) Same as
|
toString | back to summary |
---|---|
public String toString() Overrides java. Returns the name of this target. |