Permalink
Fetching contributors…
Cannot retrieve contributors at this time
119 lines (94 sloc) 4.74 KB
<?xml version="1.0" encoding="UTF-8"?>
<!-- ================================================== -->
<!-- Build Definition for Syncroton -->
<!-- -->
<!-- http://www.syncroton.org -->
<!-- ================================================== -->
<project name="syncroton" description="Syncroton build file" default="phpunit">
<property name="builddir" value="${project.basedir}/build" override="true" />
<fileset dir="lib/Syncroton" id="sourceFiles">
<include name="**/*.php" />
</fileset>
<fileset dir="tests/Syncroton" id="testFiles">
<include name="**/*Tests.php" />
<exclude name="**/AllTests.php" />
<exclude name="ServerTests.php" />
</fileset>
<!-- ============================================ -->
<!-- Target: autodiscover -->
<!-- ============================================ -->
<target name="autodiscover">
<echo msg="(Re)Creating autodiscover.php..." />
<!-- @todo implement -->
</target>
<!-- ============================================ -->
<!-- Target: clean -->
<!-- ============================================ -->
<target name="clean">
<echo msg="Cleaning up ${builddir}..." />
<delete dir="${builddir}" quiet="true" />
</target>
<!-- ============================================ -->
<!-- Target: phpdoc -->
<!-- ============================================ -->
<target name="phpdoc">
<echo msg="Building Syncroton API Documentation..." />
<includepath classpath="${project.basedir}/vendor/phpdocumentor" />
<mkdir dir="${builddir}/apidocs" />
<phpdoc2 title="Syncroton API Documentation" destdir="${builddir}/apidocs" template="responsive-twig">
<fileset refid="sourceFiles" />
</phpdoc2>
</target>
<!-- ============================================ -->
<!-- Target: phpunit -->
<!-- ============================================ -->
<target name="phpunit">
<echo msg="Starting Tests..." />
<delete dir="${builddir}/reports" quiet="true" />
<mkdir dir="${builddir}/reports/tests" />
<phpunit configuration="tests/phpunit.xml" haltonfailure="true" haltonerror="true" printsummary="true">
<formatter type="plain" usefile="false" />
<formatter type="xml" todir="${builddir}/reports" />
<batchtest>
<fileset refid="testFiles" />
</batchtest>
</phpunit>
<phpunitreport infile="${builddir}/reports/testsuites.xml" format="frames" todir="${builddir}/reports/tests" />
</target>
<!-- ============================================ -->
<!-- Target: report -->
<!-- ============================================ -->
<target name="report">
<echo msg="Starting Tests..." />
<delete dir="${builddir}/reports" quiet="true" />
<mkdir dir="${builddir}/reports/tests" />
<mkdir dir="${builddir}/reports/coverage" />
<coverage-setup database="${builddir}/reports/coverage.db">
<fileset refid="sourceFiles" />
</coverage-setup>
<phpunit codecoverage="true" configuration="tests/phpunit.xml" haltonfailure="true" haltonerror="true" printsummary="true">
<formatter type="xml" todir="${builddir}/reports" />
<batchtest>
<fileset refid="testFiles" />
</batchtest>
</phpunit>
<phpunitreport infile="${builddir}/reports/testsuites.xml" format="frames" todir="${builddir}/reports/tests" />
<coverage-report outfile="${builddir}/reports/coverage.xml">
<report todir="${builddir}/reports/coverage" title="Syncroton" />
</coverage-report>
</target>
<!-- ============================================ -->
<!-- Target: compose -->
<!-- ============================================ -->
<target name="compose">
<echo msg="Fetching dependencies" />
<exec command="composer install" passthru="true" />
</target>
<!-- ============================================ -->
<!-- Target: compose-dev -->
<!-- ============================================ -->
<target name="compose-dev">
<echo msg="Fetching dependencies for development" />
<exec command="composer --dev install" passthru="true" />
</target>
</project>