-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (34 loc) · 961 Bytes
/
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
.PHONY: build tools tests code-coverage linting
build:
@composer install
tools:
@echo $@ # print target name
@echo Checking toolchain
ifeq (,$(wildcard ${CURDIR}/vendor/bin/phpcs))
@make build
else
@echo squizlabs/php_codesniffer phpcs ready!
endif
ifeq (,$(wildcard ${CURDIR}/vendor/bin/phpcbf))
@make build
else
@echo squizlabs/php_codesniffer phpcbf ready!
endif
ifeq (,$(wildcard ${CURDIR}/vendor/bin/phpmd))
@make build
else
@echo phpmd/phpmd ready!
endif
ifeq (,$(wildcard ${CURDIR}/vendor/bin/phpunit))
@make build
else
@echo phpunit/phpunit ready!
endif
tests: tools
@./vendor/bin/phpunit --configuration phpunit.xml
code-coverage: tools
@./vendor/bin/phpunit --coverage-html code-coverage/
linting: tools
@./vendor/bin/phpmd example,src text cleancode,codesize,controversial,design,naming,unusedcode
@./vendor/bin/phpcs --standard=PSR12 src example test --colors
@./vendor/bin/phpcbf --standard=PSR12 src example test --colors