-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (50 loc) · 1.32 KB
/
Makefile
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
COMPOSER_CMD=composer
PHIVE_CMD=phive
PHPSPEC_CMD=tools/phpspec
BEHAT_CMD=tools/behat
README_TESTER_CMD=tools/readme-tester
PHPSTAN_CMD=tools/phpstan
PHPCS_CMD=tools/phpcs
.DEFAULT_GOAL=all
.PHONY: all
all: test analyze
.PHONY: clean
clean:
rm composer.lock
rm -rf vendor
rm -rf tools
.PHONY: test
test: phpspec behat docs
.PHONY: phpspec
phpspec: vendor/installed $(PHPSPEC_CMD)
$(PHPSPEC_CMD) run
.PHONY: behat
behat: vendor/installed $(BEHAT_CMD)
$(BEHAT_CMD) --stop-on-failure
.PHONY: docs
docs: vendor/installed $(README_TESTER_CMD)
$(README_TESTER_CMD) README.md
.PHONY: analyze
analyze: phpstan phpcs
.PHONY: phpstan
phpstan: vendor/installed $(PHPSTAN_CMD)
$(PHPSTAN_CMD) analyze -c phpstan.neon -l 7 src
.PHONY: phpcs
phpcs: $(PHPCS_CMD)
$(PHPCS_CMD) src --standard=PSR2 --ignore=router_template.php
$(PHPCS_CMD) spec --standard=spec/ruleset.xml
composer.lock: composer.json
@echo composer.lock is not up to date
vendor/installed: composer.lock
$(COMPOSER_CMD) install
touch $@
$(PHPSPEC_CMD):
$(PHIVE_CMD) install phpspec/phpspec:6 --force-accept-unsigned
$(BEHAT_CMD):
$(PHIVE_CMD) install behat/behat:3 --force-accept-unsigned
$(README_TESTER_CMD):
$(PHIVE_CMD) install hanneskod/readme-tester:1 --force-accept-unsigned
$(PHPSTAN_CMD):
$(PHIVE_CMD) install phpstan
$(PHPCS_CMD):
$(PHIVE_CMD) install phpcs