-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
88 lines (62 loc) · 2.26 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
default: build
build: install test
.PHONY: build
install:
composer install
.PHONY: install
update:
composer update
.PHONY: update
update-min:
composer update --prefer-stable --prefer-lowest
.PHONY: update-min
update-no-dev:
composer update --prefer-stable --no-dev
.PHONY: update-no-dev
test: vendor cs phpunit
.PHONY: test
test-min: update-min cs phpunit
.PHONY: test-min
test-package: test-package-tools
cd tests/phar && ./tools/phpunit
.PHONY: test-package
cs: tools/php-cs-fixer
PHP_CS_FIXER_IGNORE_ENV=1 tools/php-cs-fixer --dry-run --allow-risky=yes --no-interaction --ansi fix
cs-fix: tools/php-cs-fixer
PHP_CS_FIXER_IGNORE_ENV=1 tools/php-cs-fixer --allow-risky=yes --no-interaction --ansi fix
phpunit: vendor
vendor/bin/phpunit
.PHONY: phpunit
clean:
rm -rf build
rm -rf vendor
find tools -not -path '*/\.*' -type f -delete
find tests/phar/tools -not -path '*/\.*' -type f -delete
.PHONY: clean
build/zalas-phpunit-globals-extension.phar: tools/box
$(eval VERSION=$(shell git describe --abbrev=0 --tags 2> /dev/null | sed -e 's/^v//' || echo 'dev'))
@rm -rf build/phar && mkdir -p build/phar
cp -r src LICENSE composer.json build/phar
sed -e 's/@@version@@/$(VERSION)/g' manifest.xml.in > build/phar/manifest.xml
cd build/phar && \
composer remove phpunit/phpunit --no-update && \
composer config platform.php 8.1 && \
composer update --no-dev -o -a
tools/box compile
@rm -rf build/phar
package: build/zalas-phpunit-globals-extension.phar
.PHONY: package
vendor: install
vendor/bin/phpunit: install
tools: tools/php-cs-fixer tools/box
.PHONY: tools
tools/php-cs-fixer:
curl -Ls http://cs.symfony.com/download/php-cs-fixer-v3.phar -o tools/php-cs-fixer && chmod +x tools/php-cs-fixer
tools/box:
curl -Ls https://github.com/humbug/box/releases/download/4.2.0/box.phar -o tools/box && chmod +x tools/box
test-package-tools: tests/phar/tools/phpunit tests/phar/tools/phpunit.d/zalas-phpunit-globals-extension.phar
.PHONY: test-package-tools
tests/phar/tools/phpunit: vendor
ln -sf $(CURDIR)/vendor/bin/phpunit tests/phar/tools/phpunit
tests/phar/tools/phpunit.d/zalas-phpunit-globals-extension.phar: build/zalas-phpunit-globals-extension.phar
cp build/zalas-phpunit-globals-extension.phar tests/phar/tools/phpunit.d/zalas-phpunit-globals-extension.phar