diff options
Diffstat (limited to 'buildscripts/phing/classes/phing/tasks/system/PhingCallTask.php')
-rwxr-xr-x[-rw-r--r--] | buildscripts/phing/classes/phing/tasks/system/PhingCallTask.php | 106 |
1 files changed, 64 insertions, 42 deletions
diff --git a/buildscripts/phing/classes/phing/tasks/system/PhingCallTask.php b/buildscripts/phing/classes/phing/tasks/system/PhingCallTask.php index 34d4336d..2aec4db5 100644..100755 --- a/buildscripts/phing/classes/phing/tasks/system/PhingCallTask.php +++ b/buildscripts/phing/classes/phing/tasks/system/PhingCallTask.php @@ -1,7 +1,7 @@ <?php /* - * $Id: PhingCallTask.php 59 2006-04-28 14:49:47Z mrook $ - * + * $Id: 5d02fa25dc18b56093884ae756b1720aafb42937 $ + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -24,7 +24,7 @@ require_once 'phing/Task.php'; /** * Call another target in the same project. * - * <pre> + * <samp> * <target name="foo"> * <phingcall target="bar"> * <property name="property1" value="aaaaa" /> @@ -35,24 +35,44 @@ require_once 'phing/Task.php'; * <target name="bar" depends="init"> * <echo message="prop is ${property1} ${foo}" /> * </target> - * </pre> + * </samp> * - * <p>This only works as expected if neither property1 nor foo are - * defined in the project itself. + * This only works as expected if neither property1 nor foo are defined in the project itself. * * @author Andreas Aderhold <andi@binarycloud.com> * @copyright 2001,2002 THYRELL. All rights reserved - * @version $Revision: 1.9 $ + * @version $Id: 5d02fa25dc18b56093884ae756b1720aafb42937 $ * @access public * @package phing.tasks.system */ class PhingCallTask extends Task { + /** + * The called Phing task. + * + * @var PhingTask + */ private $callee; + + /** + * The target to call. + * + * @var string + */ private $subTarget; - // must match the default value of PhingTask#inheritAll + + /** + * Whether to inherit all properties from current project. + * + * @var boolean + */ private $inheritAll = true; - // must match the default value of PhingTask#inheritRefs + + /** + * Whether to inherit refs from current project. + * + * @var boolean + */ private $inheritRefs = false; /** @@ -67,7 +87,7 @@ class PhingCallTask extends Task { /** * If true, pass all references to the new Phing project. * Defaults to false. Future use. - * + * * @param boolean new value */ function setInheritRefs($inheritRefs) { @@ -75,6 +95,34 @@ class PhingCallTask extends Task { } /** + * Alias for createProperty + * @see createProperty() + */ + function createParam() { + if ($this->callee === null) { + $this->init(); + } + return $this->callee->createProperty(); + } + + /** + * Property to pass to the invoked target. + */ + function createProperty() { + if ($this->callee === null) { + $this->init(); + } + return $this->callee->createProperty(); + } + + /** + * Target to execute, required. + */ + function setTarget($target) { + $this->subTarget = (string) $target; + } + + /** * init this task by creating new instance of the phing task and * configuring it's by calling its own init method. */ @@ -82,6 +130,7 @@ class PhingCallTask extends Task { $this->callee = $this->project->createTask("phing"); $this->callee->setOwningTarget($this->getOwningTarget()); $this->callee->setTaskName($this->getTaskName()); + $this->callee->setHaltOnFailure(true); $this->callee->setLocation($this->getLocation()); $this->callee->init(); } @@ -91,17 +140,17 @@ class PhingCallTask extends Task { * @throws BuildException on validation failure or if the target didn't * execute */ - function main() { - - $this->log("Running PhingCallTask for target '" . $this->subTarget . "'", PROJECT_MSG_DEBUG); + function main() { + + $this->log("Running PhingCallTask for target '" . $this->subTarget . "'", Project::MSG_DEBUG); if ($this->callee === null) { $this->init(); } if ($this->subTarget === null) { - throw new BuildException("Attribute target is required.", $this->location); + throw new BuildException("Attribute target is required.", $this->getLocation()); } - + $this->callee->setPhingfile($this->project->getProperty("phing.file")); $this->callee->setTarget($this->subTarget); $this->callee->setInheritAll($this->inheritAll); @@ -109,31 +158,4 @@ class PhingCallTask extends Task { $this->callee->main(); } - /** - * Alias for createProperty - * @see createProperty() - */ - function createParam() { - if ($this->callee === null) { - $this->init(); - } - return $this->callee->createProperty(); - } - - /** - * Property to pass to the invoked target. - */ - function createProperty() { - if ($this->callee === null) { - $this->init(); - } - return $this->callee->createProperty(); - } - - /** - * Target to execute, required. - */ - function setTarget($target) { - $this->subTarget = (string) $target; - } } |