Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

126 lines (108 sloc) 4.451 kb
<?xml version="1.0" encoding="utf-8"?>
<project name="CakePHP" default="build">
<taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2" />
<property file="" />
<property name="package" value="${}" override="true" />
The set of files we're going to package
Exclude the cli scripts, as they get installed separately.
<fileset id="libs" dir="./lib/Cake">
<include name="**" />
<exclude name="Console/cake.bat" />
<exclude name="Console/cake.php" />
<exclude name="Console/cake" />
CLI scripts to package and install
<fileset id="cli" dir="./lib/Cake/Console">
<include name="cake.bat" />
<include name="cake.php" />
<include name="cake" />
<!-- start fresh each time. Remove the dist and build dirs -->
<target name="clean">
<delete dir="${build.dir}" includeemptydirs="true" />
<delete dir="${dist.dir}" includeemptydirs="true" />
<!-- makes directories and sets properties -->
<target name="prepare" depends="clean">
<echo msg="Creating build + dist directories." />
<mkdir dir="${build.dir}" />
<mkdir dir="${dist.dir}" />
<exec executable="php" outputProperty="version">
<arg value="-r" />
<arg value="$fh = file('./lib/Cake/VERSION.txt'); echo strtoupper(array_pop($fh));" />
<!-- set PEAR stability based on version number. -->
<condition property="pear.stability" value="beta">
<contains string="${version}" substring="beta" casesensitive="false"/>
<condition property="pear.stability" value="alpha">
<contains string="${version}" substring="alpha" casesensitive="false"/>
<condition property="pear.stability" value="devel">
<contains string="${version}" substring="dev" casesensitive="false"/>
<condition property="pear.stability" value="beta">
<contains string="${version}" substring="rc" casesensitive="false" />
<condition property="pear.stability" value="stable">
<not><isset property="pear.stability"/></not>
<!-- pear versions need to not have '-' -->
<exec executable="php" outputProperty="pear.version">
<arg value="-r" />
<arg value="echo str_replace(array('-'), array(''), '${version}');" />
<echo msg="Preparing package of ${version} (${pear.version}+${pear.stability})" />
Copy all the files to build/ so they can be packaged up.
<target name="copy-files" depends="prepare">
<echo msg="Copying files to build directory" />
<copy todir="${build.dir}/${}-${version}/Cake">
<fileset refid="libs" />
<copy todir="${build.dir}/${}-${version}/bin">
<fileset refid="cli" />
Define the package.xml. Using xml to make xml is fun!
<target name="define-pear-package" depends="copy-files">
<d51pearpkg2 baseinstalldir="/" dir="${build.dir}/${}-${version}">
<summary>CakePHP Framework</summary>
<description>CakePHP </description>
<lead user="mark_story" name="Mark Story" email="" />
<license>MIT License</license>
<version release="${pear.version}" api="${pear.version}" />
<stability release="${pear.stability}" api="${pear.stability}" />
<php minimum_version="5.2.9" />
<pear minimum_version="1.9.0" recommended_version="1.9.4" />
<package name="PHPUnit" channel="" minimum_version="3.5.0" type="optional" />
<dirroles key="bin">script</dirroles>
<install as="cake" name="bin/cake" />
<install as="cake.php" name="bin/cake.php" />
<install as="cake.bat" name="bin/cake.bat" />
<!-- Generate the PEAR package from a directory and move the files to the dist folder -->
<target name="generate-package" depends="define-pear-package">
<exec command="pear package" dir="${build.dir}/${}-${version}" passthru="true"/>
<echo msg="Moving ${}-${pear.version}.tgz"/>
<move file="${build.dir}/${}-${version}/${}-${pear.version}.tgz" todir="${dist.dir}" />
<!-- top level easy to type target -->
<target name="build" depends="generate-package" />
Jump to Line
Something went wrong with that request. Please try again.