|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<project name="app" basedir="."> |
| 3 | + |
| 4 | + <condition property="ext" value=".bat"> |
| 5 | + <os family="windows"/> |
| 6 | + </condition> |
| 7 | + |
| 8 | + <condition property="ext" value=".bat" else=""> |
| 9 | + <os family="windows"/> |
| 10 | + </condition> |
| 11 | + |
| 12 | + <target name="phpunit" description="Run PHPUnit"> |
| 13 | + <exec executable="${basedir}/vendor/bin/phpunit${ext}" searchpath="true" resolveexecutable="true" failonerror="true" taskname="phpunit"> |
| 14 | + <arg value="--configuration"/> |
| 15 | + <arg path="${basedir}/phpunit.xml"/> |
| 16 | + </exec> |
| 17 | + </target> |
| 18 | + |
| 19 | + <target name="phpunit-coverage" description="Run unit tests with PHPUnit with coverage"> |
| 20 | + <delete dir="${basedir}/build/coverage"/> |
| 21 | + <mkdir dir="${basedir}/build/coverage"/> |
| 22 | + <exec executable="${basedir}/vendor/bin/phpunit${ext}" searchpath="true" resolveexecutable="true" |
| 23 | + failonerror="true" taskname="phpunit-coverage"> |
| 24 | + <arg value="--coverage-text"/> |
| 25 | + <arg value="--configuration"/> |
| 26 | + <arg path="${basedir}/phpunit.xml"/> |
| 27 | + <arg value="--coverage-clover"/> |
| 28 | + <arg path="${basedir}/build/logs/clover.xml"/> |
| 29 | + <arg value="--coverage-html"/> |
| 30 | + <arg path="${basedir}/build/coverage"/> |
| 31 | + </exec> |
| 32 | + </target> |
| 33 | + |
| 34 | + <target name="fix-style" description="Code style fixer"> |
| 35 | + <mkdir dir="${basedir}/build"/> |
| 36 | + <get src="http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar" dest="${basedir}/build/php-cs-fixer.phar" skipexisting="true"/> |
| 37 | + <exec executable="php" searchpath="true" resolveexecutable="true" failonerror="true"> |
| 38 | + <arg value="${basedir}/build/php-cs-fixer.phar"/> |
| 39 | + <arg line="fix --config=.cs.php"/> |
| 40 | + </exec> |
| 41 | + </target> |
| 42 | + |
| 43 | + <target name="check-style" description="Code style check"> |
| 44 | + <mkdir dir="${basedir}/build"/> |
| 45 | + <get src="http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar" dest="${basedir}/build/php-cs-fixer.phar" skipexisting="true"/> |
| 46 | + <exec executable="php" searchpath="true" resolveexecutable="true" failonerror="true"> |
| 47 | + <arg value="${basedir}/build/php-cs-fixer.phar"/> |
| 48 | + <arg line="fix --dry-run --format=txt --verbose --diff --diff-format=udiff --config=.cs.php"/> |
| 49 | + </exec> |
| 50 | + </target> |
| 51 | + |
| 52 | + <target name="phpstan" description="PHP Static Analysis Tool - discover bugs in your code without running it"> |
| 53 | + <mkdir dir="${basedir}/build"/> |
| 54 | + <get src="https://github.com/phpstan/phpstan/releases/download/0.9.2/phpstan.phar" |
| 55 | + dest="${basedir}/build/phpstan.phar" skipexisting="true"/> |
| 56 | + <exec executable="php" searchpath="true" resolveexecutable="true" failonerror="true"> |
| 57 | + <arg value="${basedir}/build/phpstan.phar"/> |
| 58 | + <arg value="analyse"/> |
| 59 | + <arg value="-l"/> |
| 60 | + <arg value="5"/> |
| 61 | + <arg value="src"/> |
| 62 | + <arg value="tests"/> |
| 63 | + <arg value="--no-interaction"/> |
| 64 | + <arg value="--no-progress"/> |
| 65 | + </exec> |
| 66 | + </target> |
| 67 | + |
| 68 | + <target name="check-travis" depends="check-style,phpstan"/> |
| 69 | + |
| 70 | +</project> |
0 commit comments