Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
169 lines (143 sloc) 5.95 KB
<?xml version="1.0" encoding="UTF-8" ?>
<project name="Cumula Web Framework" default="test">
<property file="build.properties" />
<!-- Clean the repository -->
<target name="test.clean" description="clean up after the automated tests">
<delete dir="${project.coveragedir}" />
</target>
<!-- Prepare the directory for the tests -->
<target name="test.prepare" depends="test.clean" description="Prepare to run the Automated Testss">
<mkdir dir="${project.coveragedir}" />
<mkdir dir="${tests.reportdir}" />
<mkdir dir="${coverage.reportdir}" />
</target>
<!-- Execute Unit Tests for a single class -->
<target name="test.one" depends="test.prepare" description="Run a single test class">
<propertyprompt propertyName="test.tmpclass" defaultValue="" promptText="Which Class would you like to run?" />
<propertyprompt propertyName="test.buildreport" defaultValue="n" promptText="Would you like to build a report?" />
<phingCall target="test.execute">
<property name="test.class" value="${test.tmpclass}.Test" />
</phingCall>
</target>
<!-- Execute Unit Tests -->
<target name="test.execute" description="Execute unit tests">
<fail unless="test.class" msg="No Class available to Test" />
<if>
<and>
<not><isset property="test.coverage" /></not>
<equals arg1="${test.buildreport}" arg2="y" casesensitive="false" />
</and>
<then>
<property name="test.coverage" value="false" />
</then>
<else>
<property name="test.coverage" value="true" />
</else>
</if>
<!-- Run the automated tests -->
<phpunit haltonerror="false" haltonfailure="false" codecoverage="false"
haltonskipped="false" bootstrap="${project.basedir}/Cumula/Test/bootstrap.php">
<formatter type="xml" usefile="true" todir="${tests.reportdir}" />
<formatter type="plain" usefile="false" />
<batchtest name="Cumula Automated Tests">
<fileset dir="${project.basedir}/Cumula">
<include name="**/Test/**/${test.class}.php" />
<exclude name="base/*.php" />
<exclude name="bootstrap.php" />
</fileset>
</batchtest>
</phpunit>
</target>
<!-- Perform Automated Tests -->
<target name="test" depends="test.prepare" description="Run the Automated Tests and generate reports">
<if>
<not><isset property="test.class"/></not>
<then>
<property name="test.class" value="*" />
</then>
</if>
<phingCall target="test.execute">
<property name="test.coverage" value="true" />
<property name="test.buildreport" value="y" />
</phingCall>
</target>
<target name="app.clean.all" depends="app.clean.prompt, app.clean.data, app.clean.config"
description="Clean all of the applications data and config files">
</target>
<target name="app.clean.data" depends="app.clean.prompt" description="Remove the application data directory">
<delete dir="${app.path}data" />
</target>
<target name="app.clean.config" depends="app.clean.prompt" description="Remove the application config directory">
<delete dir="${app.path}config" />
</target>
<target name="app.clean.prompt" description="Prompt the user for the application information">
<if>
<not><isset property="app.clean.assertTrue" /></not>
<then>
<propertyprompt propertyName="app.clean.assertTrue" defaultValue="n"
promptText="Are you sure you want to delete the application files?" />
</then>
</if>
<condition property="cleanTrue">
<or>
<equals arg1="${app.clean.assertTrue}" arg2="y" />
<equals arg1="${app.clean.assertTrue}" arg2="Y" />
</or>
</condition>
<fail unless="cleanTrue" message="Decided not to clean the application" />
<condition property="getAppName">
<and>
<not><isset property="app.name" /></not>
</and>
</condition>
<if>
<istrue value="${getAppName}" />
<then>
<propertyprompt propertyName="app.name" defaultValue="app" promptText="Application you wish to clean" />
<property name="app.path" value="${project.basedir}/../${app.name}/" />
</then>
</if>
</target>
<!-- Build Archives -->
<target name="build" depends="build.prepare" description="Build a tarball and zip for the project">
<propertyprompt propertyName="build.ref" defaultValue="master" promptText="Which Ref are you building for?" />
<exec command="git clone --recursive git://github.com/Cumula/framework.git ${project.builddir}/cumula-${build.ref}"
dir="${project.basedir}" />
<exec command="git checkout ${build.ref}; git submodule update" dir="${project.builddir}/cumula-${build.ref}" />
<!-- .tar.gz file -->
<tar destfile="${project.builddir}/cumula-${build.ref}.tgz" compression="gzip">
<fileset dir="${project.builddir}/cumula-${build.ref}/">
<include name="**/**" />
<exclude name="**/.git**" />
</fileset>
</tar>
<!-- .tar.bz2 file -->
<tar destfile="${project.builddir}/cumula-${build.ref}.tbz" compression="bzip2">
<fileset dir="${project.builddir}/cumula-${build.ref}/">
<include name="**/**" />
<exclude name="**/.git**" />
</fileset>
</tar>
<!-- .zip file -->
<zip destfile="${project.builddir}/cumula-${build.ref}.zip">
<fileset dir="${project.builddir}/cumula-${build.ref}/">
<include name="**/**" />
<exclude name="**/.git**" />
</fileset>
</zip>
</target>
<target name="build.prepare" depends="build.clean" description="Prepare the repository for a build">
<mkdir dir="${project.builddir}" />
</target>
<target name="build.clean" description="Clean the build directory in preparation for a new build">
<delete dir="${project.builddir}" />
</target>
<target name="build.docs" description="Build DocBlox Documentation">
<docblox title="Cumula API Documentation" destdir="docs">
<fileset dir="${project.basedir}">
<exclude name="**/.inc"/>
<exclude name="**/components/**/libraries/**" />
</fileset>
</docblox>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.