forked from markuspoerschke/iCal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
103 lines (79 loc) · 2.43 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
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
-include Makefile.local
export XDEBUG_MODE=coverage
MAKEFLAGS += --warn-undefined-variables
SHELL := bash
PATH := $(CURDIR)/vendor/bin:$(PATH)
PSALM_FLAGS ?=
PHPUNIT_FLAGS ?=
INFECTION_FLAGS ?=
.PHONY: test
test: test-validate-composer test-code-style test-psalm test-phpunit test-examples test-composer-normalize test-phpmd test-infection
.PHONY: test-code-style
test-code-style: dependencies
php-cs-fixer fix --dry-run --diff
.PHONY: test-psalm
test-psalm: dependencies
psalm -m --no-progress ${PSALM_FLAGS}
.PHONY: test-phpunit
test-phpunit: dependencies
phpunit --coverage-xml=build/coverage/coverage-xml --log-junit=build/coverage/junit.xml ${PHPUNIT_FLAGS}
.PHONY: test-examples
EXAMPLE_FILES := $(wildcard examples/*.php)
test-examples: $(EXAMPLE_FILES)
.PHONY: test-infection
test-infection: dependencies test-phpunit
test-infection:
infection --min-msi=60 --coverage=build/coverage ${INFECTION_FLAGS}
examples/example*.php: dependencies
php $@ > /dev/null
.PHONY: test-validate-composer
test-validate-composer:
composer validate
.PHONY: test-composer-normalize
test-composer-normalize: dependencies
test-composer-normalize:
composer normalize --dry-run --diff
.PHONY: test-phpmd
test-phpmd: dependencies
test-phpmd:
phpmd ./src text rulesets.xml
.PHONY: test-prettier
test-prettier:
yarn
npx prettier --check .
.PHONY: dependencies
dependencies:
composer install --no-interaction
.PHONY: fix
fix: fix-code-style fix-composer
.PHONY: fix-code-style
fix-code-style: dependencies
fix-code-style:
php-cs-fixer -- fix
.PHONY: fix-composer
fix-composer: dependencies
fix-composer:
composer normalize --no-update-lock
composer update nothing
.PHONY: fix-prettier
fix-prettier:
yarn
npx prettier --write .
.PHONY: docs
docs: docs-dependencies docs-frontend-build
php couscous.phar generate
.PHONY: docs-dependencies
docs-dependencies:
if [ ! -f couscous.phar ]; then php -r "copy('https://github.com/CouscousPHP/Couscous/releases/download/1.8.0/couscous.phar', 'couscous.phar');"; fi
.PHONY: docs-preview
docs-preview: docs-dependencies docs-frontend-build
php couscous.phar preview
.PHONY: docs-frontend-dependencies
docs-frontend-dependencies:
cd website && yarn
.PHONY: docs-frontend-build
docs-frontend-build: docs-frontend-dependencies
cd website && yarn build
.PHONY: clean
clean:
rm -rf vendor composer.lock .couscous website/node_modules website/template/static couscous.phar node_modules .phpunit.result.cache .php_cs.cache report