B.39 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.49, “PropertyTask ”), <fileset> Tags (see Section D.4, “FileSet”) or <reference> Tags.

Table B.40: Attributes

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
outputStringFilename to write the Phing output to. This is relative to the value of the dir attribute if it has been set or to the basedir of the current project otherwise.n/aNo
usenativebasedirBooleanIf set to "true", the child build will use the same basedir as it would have used when run from the command line (i.e. the basedir one would expect when looking at the child build's buildfile).falseNo

B.39.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" />

B.39.2 Supported Nested Tags

B.39.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.41: 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