<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleBuildProjectPHP" description="Sample Phing Build Project" basedir="." default="list-targets" phingVersion="2.6.1" >
<property file="./build.properties" />
<property name="package" value="${phing.project.name}" override="true" />
<!-- ============================================ -->
<!-- Target: list targets (DEFAULT) -->
<!-- ============================================ -->
<target name="list-targets" description="list all phing targets">
<exec command="phing -f ${phing.file} -l" outputProperty="phing_targets" />
<echo>Available targets:</echo>
<echo>${phing_targets}</echo>
</target>
<!-- ============================================ -->
<!-- Target: run composer install -->
<!-- ============================================ -->
<target name="run-composer-install" description="running composer install">
<exec command="${composer.exec} install --prefer-source --no-interaction" dir="${project.basedir}" passthru="true" checkreturn="true" />
</target>
<!-- ============================================ -->
<!-- Target: build -->
<!-- ============================================ -->
<target name="make-build" description="create build directory">
<mkdir dir="${dir.build}" />
</target>
<target name="build" depends="make-build, run-composer-install" />
<!-- ============================================ -->
<!-- Target: clean -->
<!-- ============================================ -->
<target name="clean-vendor" description="remove vendor directory">
<delete dir="${dir.vendor}" />
</target>
<target name="clean-build" description="remove build directory">
<delete dir="${dir.build}" />
</target>
<target name="clean" depends="clean-build" />
<!-- ============================================ -->
<!-- Target: report -->
<!-- ============================================ -->
<target name="phplint">
<echo msg="Before phplint / phing phplint" />
<exec command="${phplint.exec} ${dir.src}" dir="${project.basedir}" passthru="true" checkreturn="true" />
<exec command="${phplint.exec} ${dir.test}" dir="${project.basedir}" passthru="true" checkreturn="true" />
<echo msg="After phplint / phint phplint" />
</target>
<target name="lint">
<phingcall target="phplint" />
</target>
<target name="phpcs" description="php codesniffer">
<echo msg="Before PHPCS / phing phpcs" />
<mkdir dir="${phpcs.output.report.dir}"/>
<exec command="${phpcs.exec} ${phpcs.args}" dir="${project.basedir}" passthru="true" checkreturn="true" />
<echo msg="After PHPCS / phing phpcs" />
</target>
<target name="report" depends="clean, build, lint, phpcs" />
<!-- ============================================ -->
<!-- Target: test -->
<!-- ============================================ -->
<target name="phpunit">
<echo msg="Before phpunit / phing phpunit" />
<mkdir dir="${phpunit.output.xml.dir}"/>
<mkdir dir="${phpunit.output.html.dir}"/>
<exec command="${phpunit.exec} ${phpunit.args}" dir="${dir.test}" passthru="true" checkreturn="true" />
<echo msg="After phpunit / phing phpunit" />
</target>
<target name="test" depends="phpunit" description="run phpunit tests"/>
<target name="full" depends="report, phpunit" description="clean, build, report and test" />
</project>
|