tasks/system/PhingTask.php
Task that invokes phing on another build file.
Use this task, for example, if you have nested buildfiles in your project. Unlike AntTask, PhingTask can even support filesets:
- Author
- Hans Lellelid
- Package
- phing.tasks.system
- Version
- $Id: 2eec26f6ebaaeceb4eca76644de88bde7515f5dc $
\PhingReference
Helper class that implements the nested <reference> element of <phing> and <phingcall>.
- Parent(s)
- \Reference
Properties


$refid= ''
- Type
- n/a
- Inherited_from
- \Reference::$$refid
Methods


__construct(
$id
=
null
)
:
void
Name | Type | Description |
---|---|---|
$id |


getReferencedObject(
$project
)
:
void
returns reference to object in references container of project
Inherited from: \Reference::getReferencedObject()Name | Type | Description |
---|---|---|
$project |


getToRefid(
)
:
\the
Get the id under which this reference will be stored in the new project
Type | Description |
---|---|
\the | id of the reference in the new project. |


setRefId(
$id
)
:
void
Name | Type | Description |
---|---|---|
$id |
\PhingTask
Task that invokes phing on another build file.
Use this task, for example, if you have nested buildfiles in your project. Unlike AntTask, PhingTask can even support filesets:
- Parent(s)
- \Task < \ProjectComponent
- Author
- Hans Lellelid
- Copyright
- 2001,2002 THYRELL. All rights reserved
- Version
- $Id: 2eec26f6ebaaeceb4eca76644de88bde7515f5dc $
Properties


$filesets= 'array()'
The filesets that contain the files PhingTask is to be run on.
array()
Details- Type
- n/a


$haltOnFailure= 'false'
Fail the build process when the called build fails?
false
Details- Type
- n/a


$inheritAll= 'true'
should we inherit properties from the parent ?
true
Details- Type
- n/a


$inheritRefs= 'false'
should we inherit references from the parent ?
false
Details- Type
- n/a


\Project
$project= 'null'
Holds a reference to the project that a project component (a task, a target, etc.) belongs to
A reference to the current project instanceInherited from: \ProjectComponent::$$project\Task::$$projectnull
Details- Type
- \Project
- Inherited_from
- \ProjectComponent::$$project
- Inherited_from
- \Task::$$project


$properties= 'array()'
the properties to pass to the new project
array()
Details- Type
- n/a


$references= 'array()'
the references to pass to the new project
array()
Details- Type
- n/a
Methods


addReferences(
)
:
void
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.
Exception | Description |
---|---|
\BuildException |


copyReference(
string $oldKey, string $newKey
)
:
void
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.
Name | Type | Description |
---|---|---|
$oldKey | string | |
$newKey | string |


createFileSet(
)
:
\FileSet
Support for filesets; This method returns a reference to an instance of a FileSet object.
Type | Description |
---|---|
\FileSet |


createProperty(
)
:
void
Property to pass to the new project.
The property is passed as a 'user property'
- Access
- public


createReference(
)
:
void
Reference element identifying a data type to carry over to the new project.
- Access
- public


getLocation(
)
:
\Location
Returns the location within the buildfile this task occurs. Used by {@link BuildException} to give detailed error messages.
Inherited from: \Task::getLocation()Type | Description |
---|---|
\Location | The location object describing the position of this task within the buildfile. |


getProject(
)
:
\Project
Returns a reference to current project
Inherited from: \ProjectComponent::getProject()\Task::getProject()Type | Description |
---|---|
\Project | Reference to current porject object |


getRuntimeConfigurableWrapper(
)
:
\RuntimeConfigurable
Returns the wrapper object for runtime configuration
Inherited from: \Task::getRuntimeConfigurableWrapper()Type | Description |
---|---|
\RuntimeConfigurable | The wrapper object used by this task |


getTaskType(
)
:
string
Returns the name of the task under which it was invoked, usually the XML tagname
Inherited from: \Task::getTaskType()Type | Description |
---|---|
string | The type of this task (XML Tag) |


init(
)
:
void
Creates a Project instance for the project to call.
Should throw a BuildException if something goes wrong with the build
This is abstract here, but may not be overloaded by subclasses.
Exception | Description |
---|---|
\BuildException |


initializeProject(
)
:
void
Configure the Project, i.e. make intance, attach build listeners (copy from father project), add Task and Datatype definitions, copy properties and references from old project if these options are set via the attributes of the XML tag.
Developer note: This function replaces the old methods "init", "_reinit" and "_initializeProject".
- Access
- protected


log(
string $msg, integer $level
=
Project::MSG_INFO
)
:
void
Name | Type | Description |
---|---|---|
$msg | string | The message to log |
$level | integer | The priority of the message |
- See
- \BuildEvent
- See
- \BuildListener


main(
)
:
void
Main entry point for the task.
Should throw a BuildException if someting goes wrong with the build
This is abstract here. Must be overloaded by real tasks.


maybeConfigure(
)
:
void
Configure this task if it hasn't been done already.
Inherited from: \Task::maybeConfigure()

overrideProperties(
)
:
void
Override the properties in the new project with the one explicitly defined as nested elements here.
Exception | Description |
---|---|
\BuildException |


reinit(
)
:
void
Called in execute or createProperty 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).
Sets all properties that have been defined as nested property elements.


setBuildfile(
$s
)
:
void
Alias function for setPhingfile
Name | Type | Description |
---|---|---|
$s |
- Access
- public


setDescription(
string $desc
)
:
void
Name | Type | Description |
---|---|---|
$desc | string | The text describing the task |


setDir(
$d
)
:
void
The directory to use as a base directory for the new phing 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.
Name | Type | Description |
---|---|---|
$d |
- Access
- public


setHaltOnFailure(
boolean $hof
)
:
void
If true, abort the build process if there is a problem with or in the target build file.
Defaults to false.
Name | Type | Description |
---|---|---|
$hof | boolean | new value |


setInheritAll(
$value
)
:
void
If true, pass all properties to the new phing project.
Defaults to true.
Name | Type | Description |
---|---|---|
$value |
- Access
- public


setInheritRefs(
$value
)
:
void
If true, pass all references to the new phing project.
Defaults to false.
Name | Type | Description |
---|---|---|
$value |
- Access
- public


setLocation(
\Location $location
)
:
void
Sets the location within the buildfile this task occurs. Called by the parser to set location information.
Inherited from: \Task::setLocation()Name | Type | Description |
---|---|---|
$location | \Location | The location object describing the position of this task within the buildfile. |


setOwningTarget(
\Target $target
)
:
void
Name | Type | Description |
---|---|---|
$target | \Target | Reference to owning target |


setPhingfile(
$s
)
:
void
The build file to use.
Defaults to "build.xml". This file is expected to be a filename relative to the dir attribute given.
Name | Type | Description |
---|---|---|
$s |
- Access
- public


setProject(
\Project $project
)
:
void
References the project to the current component.
Inherited from: \ProjectComponent::setProject()\Task::setProject()Name | Type | Description |
---|---|---|
$project | \Project | The reference to the current project |


setRuntimeConfigurableWrapper(
\RuntimeConfigurable $wrapper
)
:
void
Sets the wrapper object this task should use for runtime configurable elements.
Inherited from: \Task::setRuntimeConfigurableWrapper()Name | Type | Description |
---|---|---|
$wrapper | \RuntimeConfigurable | The wrapper object this task should use |


setTarget(
$s
)
:
void
The target of the new Phing project to execute.
Defaults to the new project's default target.
Name | Type | Description |
---|---|---|
$s |
- Access
- public


setTaskName(
string $name
)
:
string
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
string | A string representing the name of this task for log |


setTaskType(
string $name
)
:
void
Sets the type of the task. Usually this is the name of the XML tag
Inherited from: \Task::setTaskType()Name | Type | Description |
---|---|---|
$name | string | The type of this task (XML Tag) |