B.30 PhingTask

This task calls another build file. You may specify the target that is to be called within the build file. Additionally, the <phing> Tag may contain <property> Tags (see Section B.34, “PropertyTask ”).

Table B.30: Attributes

NameTypeDescriptionDefaultRequired
inheritAllBooleanIf true, pass all properties to the new phing project.trueNo
inheritRefsBooleanIf true, pass all references to the new phing project.falseNo
dirStringThe directory to use as a base directory for the new phing project. Default is 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.n/aNo
phingFileStringThe build file to use. Defaults to "build.xml". This file is expected to be a filename relative to the dir attribute given.n/aYes
targetStringThe target of the new Phing project to execute. Default is the new project's default target.n/aNo
haltonfailureBooleanIf true, fail the build process when the called build failsfalseNo

B.30.1 Examples

<!-- Call target "xslttest" from buildfile "alternativebuildfile.xml" -->
<phing phingfile="alternativebuild.xml" inheritRefs="true" target="xslttest" />

<!-- Do a more complex call -->
<phing phingfile="somebuild.xml" target="sometarget">
  <property name="foo" value="bar" />
  <property name="anotherone" value="32" />
</phing>

B.30.2 Supported Nested Tags

B.30.3 Base directory of the new project

The base directory of the new project is set dependent on the dir and the inheritAll attribute. This is important to keep in mind or else you might run into bugs in your build.xml's. The following table shows when which value is used:

Table B.31: How attributes are used

dirinheritAllnew project's basedir
value providedtruevalue of dir attribute
value providedfalsevalue of dir attribute
omittedtruebasedir of calling task (the build file containing the <phing> call.
omittedfalsebasedir attribute of the <project> element of the new project