Skip to content

Commit

Permalink
Include PHPStan to ANT buildscript
Browse files Browse the repository at this point in the history
  • Loading branch information
ruff committed Dec 12, 2020
1 parent 6b2331a commit 54ba8e7
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions build.ant.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<property name="phploc" value="${basedir}/vendor/bin/phploc"/>
<property name="phpmd" value="${basedir}/vendor/bin/phpmd"/>
<property name="phpunit" value="${basedir}/vendor/bin/phpunit"/>
<property name="phpstan" value="${basedir}/vendor/bin/phpstan"/>
<property name="sami" value="${basedir}/sami.phar"/>
<property name="git" value="/usr/bin/git"/>
<target name="clean" unless="clean.done" description="Cleanup build artifacts.">
Expand Down Expand Up @@ -128,7 +129,32 @@
</exec>
<property name="phpcs.done" value="true"/>
</target>
<target name="phpdox" unless="phpdox.done" depends="downloadphpdox,phploc-ci,phpcs-ci,phpmd-ci" description="Generate project documentation using phpDox.">
<target name="phpstan" unless="phpstan.done" description="Find coding standard violations using PHPStan and print human readable output. Intended for usage on the command line before committing.">
<exec executable="${phpstan}" taskname="phpstan">
<arg value="analyze"/>
<arg value="-c"/>
<arg path="${basedir}/build/phpstan.neon"/>
<arg value="--autoload-file=${basedir}/vendor/autoload.php"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
<arg value="--error-format=table"/>
</exec>
<property name="phpstan.done" value="true"/>
</target>
<target name="phpstan-ci" unless="phpstan.done" depends="prepare" description="Find coding standard violations using PHPStan and log result in XML format. Intended for usage within a continuous integration environment.">
<exec executable="${phpstan}" taskname="phpstan" outputproperty="phpstan.output">
<arg value="analyze"/>
<arg value="-c"/>
<arg path="${basedir}/build/phpstan.neon"/>
<arg value="--autoload-file=${basedir}/vendor/autoload.php"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
<arg value="--error-format=checkstyle"/>
</exec>
<echo message="${phpstan.output}" file="${basedir}/build/logs/checkstyle_phpstan.xml"/>
<property name="phpstan.done" value="true"/>
</target>
<target name="phpdox" unless="phpdox.done" depends="downloadphpdox,phploc-ci,phpcs-ci,phpmd-ci,phpstan-ci" description="Generate project documentation using phpDox.">
<exec executable="php" dir="${basedir}/build" taskname="phpdox">
<arg path="${phpdox}"/>
</exec>
Expand Down Expand Up @@ -215,7 +241,7 @@
<target name="quick-build" depends="prepare,composer,lint,phpunit-no-coverage" description="Perform lint check and run tests without generating code coverage reports.">
<echo message="Built"/>
</target>
<target name="static-analysis" depends="lint,phploc-ci,pdepend,phpmd-ci,phpcs-ci,phpcpd-ci" description="Perform static analysis.">
<target name="static-analysis" depends="lint,phploc-ci,pdepend,phpmd-ci,phpcs-ci,phpstan-ci,phpcpd-ci" description="Perform static analysis.">
<echo message="Done"/>
</target>
<target name="-check-failure">
Expand Down

0 comments on commit 54ba8e7

Please sign in to comment.