Permalink
Fetching contributors…
Cannot retrieve contributors at this time
179 lines (149 sloc) 5.84 KB
<?xml version="1.0" encoding="utf-8"?>
<project name="phorkie" default="zip" basedir=".">
<!--
phorkie phing build file.
This script should provide a one-stop tool for all administrative
tasks around phorkie, like creating a release version,
tagging a release
-->
<property name="version" value="0.8.1" />
<property name="stability" value="beta" />
<property name="libdir" value="${phing.dir}/lib"/>
<property name="zipfile" value="${phing.project.name}-${version}.tar.bz2" />
<property name="pharfile" value="${phing.project.name}-${version}.phar" />
<property name="pkgfile" value="${phing.project.name}-${version}.tgz" />
<property name="pharpath" value="${phing.dir}/dist/${pharfile}" />
<property name="distfile" value="dist/${zipfile}" />
<property name="distpkgfile" value="dist/pear/${pkgfile}" />
<fileset id="fs.zip" dir=".">
<include name="data/**"/>
<include name="scripts/**"/>
<include name="src/**"/>
<include name="www/**"/>
<include name="ChangeLog"/>
<include name="LICENSE"/>
<include name="NEWS.rst"/>
<include name="README.rst"/>
<exclude name="**/.git/"/>
<exclude name="**/.gitignore/"/>
<exclude name="data/cache/**"/>
<exclude name="data/config.php"/>
<exclude name="www/**/.phar"/>
<exclude name="www/repos"/>
</fileset>
<fileset id="fs.phar" dir="${phing.dir}">
<include name="data/**"/>
<include name="lib/**"/>
<include name="scripts/**"/>
<include name="src/**"/>
<include name="www/**"/>
<include name="ChangeLog"/>
<include name="README.rst"/>
<exclude name="**/.git/"/>
<exclude name="**/.gitignore/"/>
<exclude name="data/cache/**"/>
<exclude name="data/config.php"/>
<exclude name="www/**/.phar"/>
<exclude name="www/repos"/>
</fileset>
<fileset id="fs.doc" dir=".">
<include name="README.rst"/>
<include name="NEWS.rst"/>
</fileset>
<taskdef name="d51pearpkg2" classname="phing.tasks.ext.d51PearPkg2Task" />
<target name="phar" depends="preparedirs,collectdeps"
description="Create phar file for release"
>
<delete file="${pharpath}"/>
<exec command="php scripts/build-rewritemap.php" dir="${phing.dir}"/>
<pharpackage basedir="${phing.dir}"
destfile="${pharpath}"
stub="${phing.dir}/src/stub-phar.php"
alias="phorkie.phar"
>
<fileset refid="fs.phar"/>
</pharpackage>
<exec executable="bzip2" dir="${phing.dir}/dist">
<arg value="-kf"/>
<arg file="${pharpath}"/>
</exec>
</target>
<target name="collectdeps" description="Copy package dependencies to lib/">
<delete dir="${libdir}"/>
<mkdir dir="${libdir}"/>
<!-- requires phing >= 2.8.0 -->
<copy todir="${libdir}">
<pearPackageFileset package="pear.php.net/Cache_Lite"/><!-- OpenID -->
<pearPackageFileset package="pear.php.net/Console_Getopt"/>
<pearPackageFileset package="pear.php.net/Crypt_DiffieHellman"/><!-- OpenID -->
<pearPackageFileset package="pear.php.net/Date_HumanDiff"/>
<pearPackageFileset package="pear.geshi.org/geshi">
<!-- remove files that are probably not needed to save space in the .phar -->
<exclude name="geshi/arm.php"/>
<exclude name="geshi/autoit.php"/>
<exclude name="geshi/thinbasic.php"/>
</pearPackageFileset>
<pearPackageFileset package="pear.php.net/HTTP2"/>
<pearPackageFileset package="pear.php.net/HTTP_Request2"/>
<pearPackageFileset package="pear.php.net/MIME_Type"/>
<pearPackageFileset package="zustellzentrum.cweiske.de/MIME_Type_PlainDetect"/>
<pearPackageFileset package="zustellzentrum.cweiske.de/MIME_Type_PlainDetect" role="data"/>
<pearPackageFileset package="pear.michelf.com/Markdown"/>
<pearPackageFileset package="pear.php.net/Net_URL2"/>
<pearPackageFileset package="pear.php.net/OpenID"/>
<pearPackageFileset package="pear.php.net/Pager"/>
<pearPackageFileset package="pear.php.net/PEAR">
<include name="PEAR/Exception.php"/>
<include name="PEAR.php"/>
<include name="PEAR5.php"/>
<include name="OS/Guess.php"/>
<include name="System.php"/>
</pearPackageFileset>
<pearPackageFileset package="pear.php.net/Services_Libravatar"/>
<pearPackageFileset package="pear2.php.net/PEAR2_Services_Linkback"/>
<pearPackageFileset package="pear.php.net/Services_Yadis"/>
<pearPackageFileset package="pear.php.net/System_Command"/>
<pearPackageFileset package="pear.twig-project.org/Twig"/>
<pearPackageFileset package="pear.php.net/Validate"/>
<pearPackageFileset package="pear.php.net/VersionControl_Git"/>
</copy>
</target>
<target name="zip" depends="preparedirs"
description="Create zip file for release"
>
<!--
The release file is for end users, so it is safe to
remove anything developer-related.
Test your zip with: unzip -l phorkie-0.1.0.zip
-->
<echo msg="Creating distribution zip for phorkie ${version}"/>
<delete file="${distfile}" failonerror="false"/>
<tar compression="bzip2" destfile="${distfile}"
prefix="${phing.project.name}-${version}/"
>
<fileset refid="fs.zip"/>
</tar>
</target>
<target name="docs" description="render documentation">
<rST format="html" uptodate="true">
<fileset refid="fs.doc"/>
<mapper type="regexp" from="^(.+?).rst$" to="dist/docs/\1.html"/>
</rST>
</target>
<target name="clean-docs" description="delete rendered documentation files">
<delete dir="dist/docs" includeemptydirs="yes"/>
</target>
<target name="release" depends="check,phar,zip"
description="Package the new version"
>
<!-- meta-target -->
</target>
<target name="preparedirs">
<mkdir dir="dist" />
</target>
<target name="check" depends="preparedirs"
description="Check variables"
>
<fail unless="version" message="Version not defined!" />
</target>
</project>