-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
153 lines (114 loc) · 4.68 KB
/
Copy pathMakefile
File metadata and controls
153 lines (114 loc) · 4.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# Makefile for PHP Project
#
# Copyright (c) 2019 USAMI Kenta
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# License: MIT
PHP ?= php
PHPDBG ?= phpdbg -qrr
COMPOSER = composer
AUTOLOAD_PHP = vendor/autoload.php
RM = rm -f
APP_ENV =
PHPDOCUMENTOR_PHAR_URL = https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.0.0-rc/phpDocumentor.phar
.DEFAULT_GOAL := check
composer.lock: $(COMPOSER) composer.json
$(COMPOSER) install --no-progress
$(AUTOLOAD_PHP): composer.lock
tools/.infection/vendor/bin/infection:
$(COMPOSER) install --no-progress -d tools/.infection
tools/.phan/vendor/bin/phan:
$(COMPOSER) install --no-progress -d tools/.phan
tools/.php-cs-fixer/vendor/bin/php-cs-fixer:
$(COMPOSER) install --no-progress -d tools/.php-cs-fixer
tools/.phpDocumentor.phar:
$(PHP) -r "copy('$(PHPDOCUMENTOR_PHAR_URL)', 'tools/.phpDocumentor.phar');"
+chmod +x tools/.phpDocumentor.phar
tools/.phpstan/vendor/bin/phpstan:
$(COMPOSER) install --no-progress -d tools/.phpstan
tools/.psalm/vendor/bin/psalm:
$(COMPOSER) install --no-progress -d tools/.psalm
tools/infection: tools/.infection/vendor/bin/infection
(cd tools; ln -sf .infection/vendor/bin/infection .)
tools/phan: tools/.phan/vendor/bin/phan
(cd tools; ln -sf .phan/vendor/bin/phan .)
tools/php-cs-fixer: tools/.php-cs-fixer/vendor/bin/php-cs-fixer
(cd tools; ln -sf .php-cs-fixer/vendor/bin/php-cs-fixer .)
tools/phpdoc: tools/phpDocumentor.phar
(cd tools; ln -sf .phpDocumentor.phar .)
tools/phpstan: tools/.phpstan/vendor/bin/phpstan
(cd tools; ln -sf .phpstan/vendor/bin/phpstan .)
tools/psalm: tools/.psalm/vendor/bin/psalm
(cd tools; ln -sf .psalm/vendor/bin/psalm .)
.PHONY: analyse analyse-no-dev check composer composer-no-dev clean clobber doc fix phan \
phan-strict phpdoc phpstan-no-dev phpstan psalm psalm-strict setup setup-tools test
analyse-no-dev: phan phpstan-no-dev psalm-no-dev
analyse-strict: phan-strict phpstan-strict psalm-strict
analyse: phan phpstan-use-baseline psalm
check: composer test analyse
check-strict: composer test infection analyse-strict
composer: $(AUTOLOAD_PHP)
composer-no-dev:
$(COMPOSER) install --no-dev --optimize-autoloader --no-progress
clobber: clean
-$(RM) tools/*.phar tools/phan tools/php-cs-fixer tools/phpstan tools/psalm
-$(RM) -r tools/.infection/composer.lock tools/.infection/vendor
-$(RM) -r tools/.phan/composer.lock tools/.phan/vendor
-$(RM) -r tools/.php-cs-fixer/composer.lock tools/.php-cs-fixer/vendor
-$(RM) -r tools/.phpdocumentor/phpDocumentor.phar
-$(RM) -r tools/.phpstan/composer.lock tools/.phpstan/vendor
-$(RM) -r tools/.psalm/composer.lock tools/.psalm/vendor
-$(RM) -r vendor
-$(RM) composer.lock
clean:
-$(RM) -r build
-$(RM) .php_cs.cache
-$(RM) infection.log
doc: phpdoc
fix: tools/php-cs-fixer
$(PHP) tools/php-cs-fixer fix
infection: tools/infection
$(PHPDBG) tools/infection
phan: tools/phan
$(PHP) tools/phan --analyze-twice --no-progress-bar 2>/dev/null
@echo
phan-strict: tools/phan
$(PHP) tools/phan --analyze-twice --no-progress-bar -tux 2>/dev/null
@echo
phpdoc: tools/phpdoc
APP_ENV=$(APP_ENV) $(PHP) tools/phpdoc
phpstan-no-dev: tools/phpstan
$(PHP) tools/phpstan analyse --no-progress src/
phpstan-use-baseline: tools/phpstan
$(PHP) tools/phpstan analyse --no-progress -c phpstan-baseline.neon.dist
phpstan: tools/phpstan
$(PHP) tools/phpstan analyse --no-progress
psalm-no-dev: tools/psalm
$(PHP) tools/psalm --no-progress src/
psalm: tools/psalm
$(PHP) tools/psalm --no-progress
psalm-strict: tools/psalm
$(PHP) tools/psalm --no-progress --show-info=true
setup: $(COMPOSER)
setup-doc: setup tools/phpdoc
setup-tools: setup tools/php-cs-fixer tools/phan tools/phpstan tools/psalm
test: vendor/bin/phpunit
$(PHP) vendor/bin/phpunit
@echo