-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (52 loc) · 1.79 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
# If the first argument is one of the supported commands...
SUPPORTED_COMMANDS := "install"
SUPPORTS_MAKE_ARGS := $(findstring $(firstword $(MAKECMDGOALS)), $(SUPPORTED_COMMANDS))
ifneq "$(SUPPORTS_MAKE_ARGS)" ""
# use the rest as arguments for the command
COMMAND_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(COMMAND_ARGS):;@:)
endif
test: phpunit phpcs bugfree phpmd
test-analysis: phpcs bugfree phpmd
test-upload: scrutinizer
install:
make -f Makefile.docker -- composer install $(COMMAND_ARGS)
update:
.PHONY: test test-analysis test-upload pretest phpunit phpcs phpmd bugfree ocular scrutinizer clean clean-env clean-deps
pretest:
composer install --dev
phpunit: pretest
[ ! -d tests/output ] || mkdir -p tests/output
vendor/bin/phpunit --coverage-text --coverage-clover=tests/output/coverage.clover
ifndef STRICT
STRICT = 0
endif
ifeq "$(STRICT)" "1"
phpcs: pretest
vendor/bin/phpcs --standard=src/Aztech/ruleset.xml src
else
phpcs: pretest
vendor/bin/phpcs --standard=src/Aztech/ruleset.xml -n src
endif
bugfree: pretest
[ ! -f bugfree.json ] || vendor/bin/bugfree generateConfig
vendor/bin/bugfree lint src -c bugfree.json
phpmd: pretest
vendor/bin/phpmd src/ text design,naming,cleancode,codesize,controversial,unusedcode
ocular:
[ ! -f ocular.phar ] && wget https://scrutinizer-ci.com/ocular.phar
ifdef OCULAR_TOKEN
scrutinizer: ocular
@php ocular.phar code-coverage:upload --format=php-clover tests/output/coverage.clover --access-token=$(OCULAR_TOKEN);
else
scrutinizer: ocular
php ocular.phar code-coverage:upload --format=php-clover tests/output/coverage.clover;
endif
clean: clean-env clean-deps
clean-env:
rm -rf coverage.clover
rm -rf ocular.phar
rm -rf tests/output/
clean-deps:
rm -rf vendor/