-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Makefile
140 lines (105 loc) · 4.02 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
default: build
PHP_VERSION:=$(shell php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')
TOOLBOX_VERSION?=dev
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 deptrac phpunit infection
.PHONY: test
test-min: update-min cs deptrac phpunit infection
.PHONY: test-min
test-integration: build/toolbox.phar
rm -rf ./build/tools && \
export PATH="$(shell pwd)/build/tools:$(shell pwd)/build/tools/.composer/vendor/bin:$(shell pwd)/build/tools/QualityAnalyzer/bin:$$PATH" && \
export COMPOSER_HOME=$(shell pwd)/build/tools/.composer && \
chmod +x build/toolbox.phar && \
mkdir -p ./build/tools && \
build/toolbox.phar install --target-dir ./build/tools --exclude-tag exclude-php:$(PHP_VERSION) && \
build/toolbox.phar test --target-dir ./build/tools --exclude-tag exclude-php:$(PHP_VERSION)
.PHONY: test-integration
cs: tools/php-cs-fixer
PHP_CS_FIXER_IGNORE_ENV=true tools/php-cs-fixer --dry-run --allow-risky=yes --no-interaction --ansi fix
cs-fix: tools/php-cs-fixer
PHP_CS_FIXER_IGNORE_ENV=true tools/php-cs-fixer --allow-risky=yes --no-interaction --ansi fix
deptrac: tools/deptrac
tools/deptrac --no-interaction --ansi
.PHONY: deptrac
infection:
./vendor/bin/infection --no-interaction --formatter=progress --min-msi=100 --min-covered-msi=100 --only-covered --ansi
.PHONY: infection
phpunit: tools/phpunit
tools/phpunit
.PHONY: phpunit
package: tools/box
@rm -rf build/phar && mkdir -p build/phar build/phar/bin
cp -r resources src LICENSE composer.json scoper.inc.php build/phar
sed -e 's/Application('"'"'dev/Application('"'"'$(TOOLBOX_VERSION)/g' bin/toolbox.php > build/phar/bin/toolbox.php
cd build/phar && \
composer config platform.php 8.1.0 && \
composer update --no-dev -o -a
tools/box compile
@rm -rf build/phar
.PHONY: package
package-devkit: tools/box
@rm -rf build/devkit-phar && mkdir -p build/devkit-phar build/devkit-phar/bin build/devkit-phar/src
cp -r resources LICENSE composer.json scoper.inc.php build/devkit-phar
cp -r src/Json src/Runner src/Tool build/devkit-phar/src
sed -e 's/\(Application(.*\)'"'"'dev/\1'"'"'$(TOOLBOX_VERSION)/g' bin/devkit.php > build/devkit-phar/bin/devkit.php
cd build/devkit-phar && \
composer config platform.php 8.1.0 && \
composer update --no-dev -o -a
tools/box compile -c box-devkit.json.dist
@rm -rf build/devkit-phar
.PHONY: package-devkit
website: build/devkit.phar
rm -rf build/website
mkdir -p build/website
php build/devkit.phar generate:html > build/website/index.html
touch build/website/.nojekyll
.PHONY: website
publish-website: website
cd build/website && \
git init . && \
git add . && \
git commit -m "Build the website" && \
git push --force --quiet "https://github.com/jakzal/toolbox.git" master:gh-pages
.PHONY: publish-website
update-phars: vendor
php bin/devkit.php update:phars
git diff --exit-code resources/ || \
( \
git checkout -b tools-update && \
git add resources/*.json && \
git commit -m "Update tools" && \
git push origin tools-update \
)
.PHONY: update-phars
tools: tools/php-cs-fixer tools/deptrac tools/box
.PHONY: tools
clean:
rm -rf build
rm -rf vendor
find tools -not -path '*/\.*' -type f -delete
.PHONY: clean
vendor: install
vendor/bin/phpunit: install
tools/phpunit: vendor/bin/phpunit
ln -sf ../vendor/bin/phpunit tools/phpunit
tools/php-cs-fixer:
curl -Ls https://cs.symfony.com/download/php-cs-fixer-v3.phar -o tools/php-cs-fixer && chmod +x tools/php-cs-fixer
tools/deptrac:
curl -Ls https://github.com/qossmic/deptrac/releases/download/1.0.2/deptrac.phar -o tools/deptrac && chmod +x tools/deptrac
curl -Ls https://github.com/qossmic/deptrac/releases/download/1.0.2/deptrac.phar.asc -o tools/deptrac.asc
tools/box:
curl -Ls https://github.com/humbug/box/releases/download/4.2.0/box.phar -o tools/box && chmod +x tools/box