* Have Composer in `tools/composer` and managed through `composer self-update`

* Install Psalm using Phive as `tools/psalm`
* Install PHP-CS-Fixer using Phive as `tools/php-cs-fixer`
This commit is contained in:
Sebastian Bergmann 2020-01-17 13:15:49 +01:00
parent f0d18a5b81
commit efe842cd89
7 changed files with 36 additions and 19 deletions

4
.gitattributes vendored Normal file
View File

@ -0,0 +1,4 @@
/tools export-ignore
/tools/* binary
*.php diff=php

View File

@ -7,12 +7,8 @@ php:
- 7.3
- 7.4
before_install:
- composer self-update
- composer clear-cache
install:
- travis_retry composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader --prefer-stable
- travis_retry ./tools/composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader --prefer-stable
script:
- ./vendor/bin/phpunit --coverage-clover=coverage.xml

View File

@ -1,19 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="exporter" default="setup">
<target name="setup" depends="clean,composer"/>
<target name="setup" depends="clean,install-dependencies"/>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/vendor"/>
<delete file="${basedir}/composer.lock"/>
</target>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/vendor"/>
<delete file="${basedir}/composer.lock"/>
</target>
<target name="composer" depends="clean" description="Install dependencies with Composer">
<exec executable="composer" taskname="composer">
<arg value="update"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
<arg value="--no-ansi"/>
<arg value="--no-suggest"/>
</exec>
</target>
<target name="install-dependencies" depends="clean" description="Install dependencies with Composer">
<exec executable="${basedir}/tools/composer" taskname="composer">
<arg value="update"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
<arg value="--no-ansi"/>
<arg value="--no-suggest"/>
</exec>
</target>
<target name="update-tools">
<exec executable="phive" taskname="phive">
<arg value="--no-progress"/>
<arg value="update"/>
</exec>
<exec executable="${basedir}/tools/composer" taskname="composer">
<arg value="self-update"/>
</exec>
</target>
</project>

5
phive.xml Normal file
View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="php-cs-fixer" version="^2.16" installed="2.16.1" location="./tools/php-cs-fixer" copy="true"/>
<phar name="psalm" version="^3.8" installed="3.8.3" location="./tools/psalm" copy="true"/>
</phive>

BIN
tools/composer Executable file

Binary file not shown.

BIN
tools/php-cs-fixer Executable file

Binary file not shown.

BIN
tools/psalm Executable file

Binary file not shown.