-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
38 lines (31 loc) · 1.04 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
dependencies: vendor
vendor: composer.phar
@php ./composer.phar install
composer.phar:
@curl -sS https://getcomposer.org/installer | php
docker:
@docker run -it --rm -v ${PWD}:/app -w /app chialab/php:7.4 bash
test: lint
@vendor/bin/phpunit --colors test/
@php ./composer.phar validate
lint: dependencies
@if php -r 'exit(version_compare(PHP_VERSION, "5.5", ">=") ? 0 : 1);'; \
then \
php ./composer.phar require overtrue/phplint --dev; \
php ./composer.phar require squizlabs/php_codesniffer --dev; \
./vendor/bin/phplint; \
./vendor/bin/phpcs; \
else \
printf "Please update PHP version to 5.5 or above for code formatting."; \
fi
release:
@printf "releasing ${VERSION}..."
@sed -E -e "s/(public const VERSION =).+/\1 '${VERSION}';/" ./lib/PostHog.php
@node -e "var fs = require('fs'), pkg = require('./composer'); pkg.version = '${VERSION}'; fs.writeFileSync('./composer.json', JSON.stringify(pkg, null, '\t'));"
@git changelog -t ${VERSION}
@git release ${VERSION}
clean:
rm -rf \
composer.phar \
vendor \
composer.lock