C.65 PearPackageTask

With the PearPackageTask, you can create a package.xml which can be installed using the PEAR installer. Use this in conjunction with the Section C.108, “TarTask” to completely script the building of a PEAR package.


Note that this task creates a version 1 package.xml file.

This task uses the PEAR_PackageFileManager class. In order to be maximally flexible, the majority of options are set generically (using <option> tag) and are set using PEAR_PackageFileManager::setOptions() . Use the <mapping> tag to represent complex values (which are turned into associative arrays and also set using setOptions() method).

Table C.77: Attributes

nameStringThe name of the PEAR package.n/aYes
dirStringThe base directory of files to add to package.n/aYes
destFileStringThe file to create.package.xml in base directoryNo

C.65.1 Example

<pearpkg name="phing" dir="${build.src.dir}"
<fileset dir=".">
  <include name="**"/>
<option name="notes">Sample release notes here.</option>
<option name="description">Package description</option>
<option name="summary">Short description</option>
<option name="version" value="2.0.0b1"/>
<option name="state" value="beta"/>
 <mapping name="maintainers">
   <element key="handle" value="hlellelid"/>
   <element key="name" value="Hans"/>
   <element key="email" value="[email protected]"/>
   <element key="role" value="lead"/>

C.65.2 Supported Nested Tags

  • fileset

  • option

  • mapping

    The <mapping> tag represents a complex data type. You can use nested <mapping> (and nested <element> with <element> tags) to represent the full complexity of the structure. Bear in mind that what you are creating will be mapped to an associative array that will be passed in via PEAR_PackageFileMaintainer::setOptions() .

    <mapping name="option_name">
        <element key="key_name" value="key_val"/>
        <element key="key_name" value="key_val"/>
  • role See PEAR_PackageFileManager::addRole for more information.

    Table C.78: Available options

    extensionStringThe file extensionn/aYes
    roleStringThe file extensionn/aYes