Skip to content

Commit 8343a8b

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 e0e9f00 commit 8343a8b

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
@@ -3,6 +3,5 @@
33
.gitattributes export-ignore
44
.gitignore export-ignore
55
.travis.yml export-ignore
6-
build.xml export-ignore
76
phpunit.xml.dist export-ignore
87
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
@@ -27,5 +27,40 @@
2727
},
2828
"replace": {
2929
"jakub-onderka/php-console-highlighter": "*"
30+
},
31+
"scripts" : {
32+
"phplint": [
33+
"@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git"
34+
],
35+
"vardumpcheck": [
36+
"@php ./vendor/php-parallel-lint/php-var-dump-check/var-dump-check . --exclude vendor --exclude .git"
37+
],
38+
"phpcs": [
39+
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --report-full --report-checkstyle=./build/logs/checkstyle.xml"
40+
],
41+
"fixcs": [
42+
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf"
43+
],
44+
"phpunit": [
45+
"@php ./vendor/phpunit/phpunit/phpunit --no-coverage"
46+
],
47+
"coverage": [
48+
"@php ./vendor/phpunit/phpunit/phpunit"
49+
],
50+
"build": [
51+
"@phplint",
52+
"@vardumpcheck",
53+
"@phpcs",
54+
"@phpunit"
55+
]
56+
},
57+
"scripts-descriptions": {
58+
"phplint": "Check syntax errors in PHP files",
59+
"vardumpcheck": "Check PHP files for forgotten variable dumps",
60+
"phpcs": "Check PHP code style",
61+
"fixcs": "Auto-fix PHP code style",
62+
"phpunit": "PHP unit",
63+
"coverage": "PHP unit with code coverage",
64+
"build": "Run all checks"
3065
}
3166
}

0 commit comments

Comments
 (0)