Adding PHPCS to build

This commit is contained in:
Klaus Silveira
2013-05-05 21:03:18 -03:00
parent 9dbcc13245
commit fb1d18c702

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="gitlist" default="build">
<target name="build" depends="prepare,lint,phploc,pdepend,phpmd,phpcpd,phpunit" />
<target name="build" depends="prepare,lint,phploc,pdepend,phpmd,phpcpd,phpunit,phpcs" />
<target name="build-package" depends="prepare-package,lint,phploc,package" />
<target name="clean" description="Clean build artifacts">
@@ -76,6 +76,15 @@
<exec executable="phpunit" failonerror="true"/>
</target>
<target name="phpcs" description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server">
<exec executable="phpcs" output="/dev/null">
<arg value="--report=checkstyle" />
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
<arg value="--standard=PSR2" />
<arg path="${basedir}/src" />
</exec>
</target>
<target name="package" description="Package the application for distribution">
<copy todir="${basedir}/build/gitlist/">
<fileset dir="${basedir}" excludes="build/**, tests/**, pkg_builder/**, phpunit.xml.dist, cache.properties, .gitignore, .travis.yml, build.xml, composer.json, composer.lock, config.ini" />