Skip to content

Commit ea6bdaa

Browse files
jrfnlgrogy
authored andcommitted
Composer/Ant: move the build scripts to the Composer configuration
As this is a PHP project and the build steps are relatively simple, it will make it more intuitive for contributors to use Composer scripts to run CI checks, than to have to install Ant for this. This commit creates the same build/CI scripts as were previously available via Ant in the Composer configuration file. Notes: - The scripts are set up to respect the PHP version used by Composer (instead of a system default). - The scripts are set up to work equally well on Linux/Windows/Mac. - The only two differences are: - The `mkdir` and file deletions won't automatically be done anymore. Generally speaking, the `mkdir` should only need to be run once anyway and the file deletes should not be necessary as the log files will just be overwritten by the tools, so I deemed this an acceptable trade-off. - The `colors` argument won't be set anymore. For most tools, this means, the tool will default to automatically determining whether the CLI used supports colourized output. As the determination of this in most tools has become pretty good, I, again, deemed this an acceptable trade-off.
1 parent 00522e1 commit ea6bdaa

File tree

3 files changed

+35
-85
lines changed

3 files changed

+35
-85
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
.gitattributes export-ignore
33
.gitignore export-ignore
44
.travis.yml export-ignore
5-
build.xml export-ignore
65
phpunit.xml.dist export-ignore
76
phpcs.xml.dist export-ignore

build.xml

Lines changed: 0 additions & 84 deletions
This file was deleted.

composer.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,40 @@
2626
},
2727
"replace": {
2828
"jakub-onderka/php-console-color": "*"
29+
},
30+
"scripts" : {
31+
"phplint": [
32+
"@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git"
33+
],
34+
"vardumpcheck": [
35+
"@php ./vendor/php-parallel-lint/php-var-dump-check/var-dump-check . --exclude vendor --exclude .git"
36+
],
37+
"phpcs": [
38+
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --report-full --report-checkstyle=./build/logs/checkstyle.xml"
39+
],
40+
"fixcs": [
41+
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf"
42+
],
43+
"phpunit": [
44+
"@php ./vendor/phpunit/phpunit/phpunit --no-coverage"
45+
],
46+
"coverage": [
47+
"@php ./vendor/phpunit/phpunit/phpunit"
48+
],
49+
"build": [
50+
"@phplint",
51+
"@vardumpcheck",
52+
"@phpcs",
53+
"@phpunit"
54+
]
55+
},
56+
"scripts-descriptions": {
57+
"phplint": "Check syntax errors in PHP files",
58+
"vardumpcheck": "Check PHP files for forgotten variable dumps",
59+
"phpcs": "Check PHP code style",
60+
"fixcs": "Auto-fix PHP code style",
61+
"phpunit": "PHP unit",
62+
"coverage": "PHP unit with code coverage",
63+
"build": "Run all checks"
2964
}
3065
}

0 commit comments

Comments
 (0)