mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-14 19:08:25 +00:00
393bc7f1e5
Once the pear channel is setup, this will publish tar files to the pear channel.
172 lines
6.2 KiB
XML
172 lines
6.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<project name="CakePHP" default="build">
|
|
<taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2" />
|
|
|
|
<property file="build.properties" />
|
|
<property name="package" value="${phing.project.name}" 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" />
|
|
</fileset>
|
|
|
|
<!--
|
|
CLI scripts to package and install
|
|
-->
|
|
<fileset id="cli" dir="./lib/Cake/Console">
|
|
<include name="cake.bat" />
|
|
<include name="cake.php" />
|
|
<include name="cake" />
|
|
</fileset>
|
|
|
|
|
|
<!-- 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" />
|
|
</target>
|
|
|
|
<!-- 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 array_pop($fh);" />
|
|
</exec>
|
|
|
|
<!-- set PEAR stability based on version number. -->
|
|
<condition property="pear.stability" value="beta">
|
|
<contains string="${version}" substring="beta" casesensitive="false"/>
|
|
</condition>
|
|
<condition property="pear.stability" value="alpha">
|
|
<contains string="${version}" substring="alpha" casesensitive="false"/>
|
|
</condition>
|
|
<condition property="pear.stability" value="devel">
|
|
<contains string="${version}" substring="dev" casesensitive="false"/>
|
|
</condition>
|
|
<condition property="pear.stability" value="beta">
|
|
<contains string="${version}" substring="rc" casesensitive="false" />
|
|
</condition>
|
|
<condition property="pear.stability" value="stable">
|
|
<not><isset property="pear.stability"/></not>
|
|
</condition>
|
|
|
|
<!-- pear versions need to not have '-' -->
|
|
<exec executable="php" outputProperty="pear.version">
|
|
<arg value="-r" />
|
|
<arg value="echo str_replace(array('-'), array(''), '${version}');" />
|
|
</exec>
|
|
|
|
<echo msg="Preparing package of ${version} (${pear.version}+${pear.stability})" />
|
|
</target>
|
|
|
|
<!--
|
|
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}/${project.name}-${version}/Cake">
|
|
<fileset refid="libs" />
|
|
</copy>
|
|
<copy todir="${build.dir}/${project.name}-${version}/bin">
|
|
<fileset refid="cli" />
|
|
</copy>
|
|
</target>
|
|
|
|
<!--
|
|
Define the package.xml. Using xml to make xml is fun!
|
|
-->
|
|
<target name="define-pear-package" depends="copy-files">
|
|
<d51pearpkg2 baseinstalldir="/" dir="${build.dir}/${project.name}-${version}">
|
|
<name>CakePHP</name>
|
|
<summary>CakePHP Framework</summary>
|
|
<channel>pear.php.net</channel>
|
|
<description>CakePHP </description>
|
|
<lead user="mark_story" name="Mark Story" email="mark@mark-story.com" />
|
|
<lead user="lorenzo" name="José Lorenzo Rodríguez" email="jose.zap@gmail.com" />
|
|
<lead user="PhpNut" name="Larry Masters" email="phpnut@cakephp.org" />
|
|
<license>MIT License</license>
|
|
<version release="${pear.version}" api="${pear.version}" />
|
|
<stability release="${pear.stability}" api="${pear.stability}" />
|
|
<notes>http://github.com/cakephp/cakephp/blob/master/README</notes>
|
|
<dependencies>
|
|
<php minimum_version="5.2.9" />
|
|
<pear minimum_version="1.9.0" recommended_version="1.9.4" />
|
|
<package name="PHPUnit" channel="pear.phpunit.de" minimum_version="3.5.0" type="optional" />
|
|
</dependencies>
|
|
<dirroles key="bin">script</dirroles>
|
|
<release>
|
|
<install as="cake" name="bin/cake" />
|
|
<install as="cake.php" name="bin/cake.php" />
|
|
<install as="cake.bat" name="bin/cake.bat" />
|
|
</release>
|
|
</d51pearpkg2>
|
|
</target>
|
|
|
|
<!-- 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}/${project.name}-${version}" passthru="true"/>
|
|
<echo msg="Moving ${project.name}-${pear.version}.tgz"/>
|
|
<move file="${build.dir}/${project.name}-${version}/${project.name}-${pear.version}.tgz" todir="${dist.dir}" />
|
|
</target>
|
|
|
|
<!--
|
|
Bump the version number and commit that.
|
|
-->
|
|
<target name="next-version" depends="prepare">
|
|
<echo msg="Incrementing version." />
|
|
<propertyprompt propertyName="release_version" defaultValue="${version}" promptText="Enter version to be released (without -DEV)"/>
|
|
<echo msg="$file = file_get_contents('./lib/Cake/VERSION.txt'); $file = str_replace('${version}', '${release_version}', $file); file_put_contents('./lib/Cake/VERSION.txt', $file);" />
|
|
<exec executable="php">
|
|
<arg value="-r" />
|
|
<arg value="$file = file_get_contents('./lib/Cake/VERSION.txt'); $file = str_replace('${version}', '${release_version}', $file); file_put_contents('./lib/Cake/VERSION.txt', $file);" />
|
|
</exec>
|
|
<echo msg="Version number updated." />
|
|
</target>
|
|
|
|
<!--
|
|
Create the release commit that updates the version number and pushes the commits.
|
|
-->
|
|
<target name="release-commit" depends="prepare,next-version">
|
|
<echo msg="Creating new release commit" />
|
|
<exec command="git add ./lib/Cake/VERSION.txt" />
|
|
<exec command="git commit -m 'Update version number to ${release_version}'" />
|
|
<exec command="git tag -a ${release_version} -m 'CakePHP ${release_version}'" />
|
|
|
|
<propertyprompt propertyName="shipit" defaultValue="n" promptText="Ship the new commit and tag?" />
|
|
<condition property="noshipit" value="1">
|
|
<not>
|
|
<equals arg1="y" arg2="${shipit}" casesensitive="false" />
|
|
</not>
|
|
</condition>
|
|
<fail if="noshipit" msg="You said not to ship it." />
|
|
|
|
<exec command="git push ${git.remote}" />
|
|
<exec command="git push --tags ${git.remote}" />
|
|
<echo msg="Pushed commit and tag." />
|
|
</target>
|
|
|
|
<!--
|
|
Upload to pirium pear channel.
|
|
-->
|
|
<target name="distribute">
|
|
|
|
</target>
|
|
|
|
|
|
<!--
|
|
Top level easy to type targets
|
|
-->
|
|
<target name="build" depends="generate-package" />
|
|
<target name="release" depends="release-commit,build,distribute" />
|
|
|
|
</project>
|