Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

235 lines (195 sloc) 7.815 kB
<?xml version="1.0"?>
<project
name="Phing-Pirum"
description="Phing tasks for Pirum integration."
default="ftest">
<!--
This is the Phing build file for Phing-Pirum.
Phing is a build tool. Learn more about it at http://phing.info.
Copyright (c) 2010, Matt Butcher, some rights reserved.
License:
Phing-Pirum is released under an MIT license. See COPYING-MIT.txt for details.
-->
<target name="info" description="Information on using the Phing-Pirum Phing build.">
<echo>
To build:
phing build -Dversion=1.0.0
To run tests:
phing test
To emit a sample Phing-Pirum config:
phing tasks
The end.
</echo>
</target>
<target name="tasks">
<echo><![CDATA[
<!--
Set the include path to get to our tasks. Then load our tasks.
The includepath is only needed if Phing reports that it can't find pirumbuild/pirumadd.
-->
<!-- includepath classpath="path/to/PhingPirum"/ -->
<taskdef classname="PhingPirum.Task.PirumBuildTask" name="pirumbuild"/>
<taskdef classname="PhingPirum.Task.PirumAddTask" name="pirumadd"/>
]]></echo>
</target>
<!--
FROM HERE...
All tasks are for actual building and testing of Phing-Pirum.
-->
<!-- Global properties -->
<property name="srcdir" value="./src"/>
<property name="testdir" value="./tests"/>
<property name="builddir" value="./bin/build"/>
<property name="docsdir" value="./doc"/>
<property name="packagedir" value="./dist"/>
<property name="pearchannel" value="../pear.querypath.org/pear"/>
<!-- Set the include path to get to our tasks. Then load our tasks. -->
<includepath classpath="./src"/>
<taskdef classname="PhingPirum.Task.PirumBuildTask" name="pirumbuild"/>
<taskdef classname="PhingPirum.Task.PirumAddTask" name="pirumadd"/>
<!-- Files that must be included in the release -->
<!-- include name="INSTALL.mdown"/ -->
<fileset id="licensefiles" dir=".">
<include name="README.md"/>
<include name="COPYING-MIT.txt"/>
</fileset>
<!-- Files to be treated as source code -->
<fileset id="sourcecode" dir="${srcdir}">
<include name="**/*.php" />
</fileset>
<!-- Unit tests and auxilliary files -->
<fileset id="unittests" dir="${testdir}/Tests">
<include name="**/*Test.php" />
</fileset>
<!-- Documentation -->
<fileset id="docs" dir="./doc">
<include name="**/*" />
</fileset>
<!-- BUILD: The primary build target. -->
<target name="build" depends="lint, setup, fullBuild"
description="Generate docs, minimal, and full builds and then creates packages."
></target>
<!-- Target that should be run always. -->
<target name="setup" description="Run required configuration for any build.">
<tstamp/>
<!-- Default version -->
<property name="version" value="dev-${DSTAMP}"/>
</target>
<!-- Build the full package -->
<target name="fullBuild" description="Full Phing-Pirum build, including docs."
depends="setup,setPearStability">
<property name="releasedir" value="${builddir}/PhingPirum-${version}" override="true"/>
<delete dir="${releasedir}" />
<!-- Make all necessary directories. -->
<mkdir dir="${releasedir}"/>
<mkdir dir="${releasedir}/src"/>
<mkdir dir="${releasedir}/examples"/>
<mkdir dir="${releasedir}/tests"/>
<mkdir dir="${releasedir}/doc"/>
<!-- Copy license files. -->
<copy todir="${releasedir}">
<fileset refid="licensefiles"/>
</copy>
<!-- Copy source code, doing token replacement on version. -->
<copy todir="${releasedir}">
<filterchain>
<replacetokens begintoken="@" endtoken="@">
<token key="UNSTABLE" value="${version}"/>
</replacetokens>
</filterchain>
<fileset refid="sourcecode"/>
</copy>
<!-- Generate PEAR package. -->
<pearpkg2 name="PhingPirum" dir="./">
<fileset dir="${releasedir}">
<include name="**/**"/>
</fileset>
<option name="uri" value="http://querypath.org"/>
<option name="packagefile" value="package2.xml"/>
<option name="channel" value="pear.querypath.org"/>
<option name="baseinstalldir" value="PhingPirum"/>
<option name="summary" value="Pirum tasks for Phing"/>
<option name="description" value="Provides Pirum integration with Phing. Easily build PEAR channels and add packages to your channels. http://pirum-project.org"/>
<option name="apiversion" value="${version}"/>
<option name="apistability" value="${stability}"/>
<option name="releaseversion" value="${version}"/>
<option name="releasestability" value="${stability}"/>
<option name="license" value="MIT License"/>
<option name="phpdep" value="5.0.0"/>
<option name="pearinstallerdep" value="1.4.6"/>
<option name="packagetype" value="php"/>
<option name="notes" value="Latest info is available at http://github.com/technosophos/Phing-Pirum. pear.querypath.org runs Pirum."/>
<option name="outputdirectory" value="./${builddir}"/>
<option name="packagedirectory" value="./${releasedir}"/>
<mapping name="maintainers">
<element>
<element key="handle" value="technosophos"/>
<element key="name" value="M Butcher"/>
<element key="email" value="matt@aleph-null.tv"/>
<element key="role" value="lead"/>
</element>
</mapping>
<mapping name="deps">
<element>
<element key="channel" value="pear.pirum-project.org"/>
<element key="name" value="Pirum"/>
<element key="version" value="0.9.0"/>
<element key="max" value="1.0.99"/>
<element key="recommended" value="1.0.0"/>
</element>
</mapping>
</pearpkg2>
<move file="${builddir}/package2.xml" tofile="${builddir}/package.xml"/>
<!-- Create tgz and zip versions. -->
<tar destfile="${packagedir}/PhingPirum-${version}.tgz" compression="gzip">
<fileset dir="${builddir}">
<include name="Phing-Pirum-${version}/**/*"/>
<include name="package.xml"/>
</fileset>
</tar>
<pirumadd targetdir="${pearchannel}" packagefile="${packagedir}/PhingPirum-${version}.tgz"/>
</target>
<!-- Check syntax -->
<target name="lint" description="Check syntax of source.">
<phplint>
<fileset refid="sourcecode" />
</phplint>
</target>
<!-- Run a full test and format an HTML report -->
<target name="test" depends="lint" description="Run full tests">
<!-- Get a base pirum.xml file. -->
<copy file="${testdir}/pirum.xml" tofile="${testdir}/fakepear/pirum.xml"/>
<!-- Test creating a channel. -->
<pirumbuild targetdir="${testdir}/fakepear" />
<!-- Test adding a known-good package -->
<pirumadd targetdir="${testdir}/fakepear" packagefile="${testdir}/LibRIS-1.0.0.tgz"/>
<!-- Clean up. -->
<delete>
<fileset dir="${testdir}/fakepear">
<include name="**/**"/>
</fileset>
</delete>
</target>
<target name="setPearStability" depends="setup">
<property name="stability">stable</property>
<if>
<contains string="${version}" substring="dev"/>
<then>
<property name="stability" override="true">snapshot</property>
</then>
<elseif>
<contains string="${version}" substring="alpha"/>
<then>
<property name="stability" override="true">alpha</property>
</then>
</elseif>
<elseif>
<contains string="${version}" substring="beta"/>
<then>
<property name="stability" override="true">beta</property>
</then>
</elseif>
</if>
<echo>${stability}</echo>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.