2019-06-17 15:41:01 +02:00
|
|
|
.PHONY: help tests dist
|
2018-12-24 14:06:13 +01:00
|
|
|
.DEFAULT_GOAL := help
|
2019-06-20 15:32:26 +02:00
|
|
|
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
|
|
|
VERSION := $(if $(TAG),$(TAG),$(BRANCH))
|
2018-12-24 14:06:13 +01:00
|
|
|
|
|
|
|
help:
|
|
|
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-12s\033[0m %s\n", $$1, $$2}'
|
|
|
|
|
|
|
|
tests: ## Executes the test suite
|
|
|
|
vendor/bin/phpunit
|
|
|
|
|
|
|
|
coverage: ## Executes the test suite and creates code coverage reports
|
|
|
|
vendor/bin/phpunit --coverage-html build/coverage
|
|
|
|
|
|
|
|
view-coverage: ## Shows the code coverage report
|
|
|
|
open build/coverage/index.html
|
|
|
|
|
2019-06-17 15:41:01 +02:00
|
|
|
api: ## Generates api-docs
|
2019-06-20 15:32:26 +02:00
|
|
|
VERSIONTAG=$(VERSION) doxygen
|
2019-06-17 15:41:01 +02:00
|
|
|
|
|
|
|
dist: ## Generates distribution
|
|
|
|
touch .libpairtwo-dist
|
2019-06-20 15:32:26 +02:00
|
|
|
git add .libpairtwo-dist
|
2019-06-17 15:41:01 +02:00
|
|
|
git commit -m "Commit before release"
|
|
|
|
cp dist/composer* res/
|
|
|
|
mv dist/composer-dist.json dist/composer.json
|
|
|
|
cd dist && composer install
|
|
|
|
rm dist/composer.json
|
|
|
|
rm dist/composer.lock
|
|
|
|
mv dist/composer-dist-installed.json dist/composer.json
|
2019-06-20 15:32:26 +02:00
|
|
|
make api
|
2019-06-17 15:41:01 +02:00
|
|
|
mkdir -p dist/doc
|
|
|
|
cp -r doc/api dist/doc
|
2019-06-20 15:32:26 +02:00
|
|
|
cd dist && zip -r ../libpairtwo-$(VERSION)-dist.zip *
|
2019-06-17 15:41:01 +02:00
|
|
|
git reset --hard HEAD^
|
|
|
|
mv res/composer* dist/
|
|
|
|
|
2019-06-20 15:32:26 +02:00
|
|
|
clean: clean-dist clean-dev
|
|
|
|
|
|
|
|
clean-dev:
|
2019-06-17 15:41:01 +02:00
|
|
|
rm -rf doc/api
|
|
|
|
rm -rf .idea
|
|
|
|
rm -rf .libpairtwo-distro
|
|
|
|
rm -rf vendor
|
|
|
|
rm -rf composer.lock
|
2019-06-20 15:32:26 +02:00
|
|
|
|
|
|
|
clean-dist:
|
|
|
|
rm -rf dist/doc
|
2019-06-17 15:41:01 +02:00
|
|
|
rm -rf dist/vendor
|
|
|
|
rm -rf dist/composer.json
|
2019-06-20 15:32:26 +02:00
|
|
|
rm -rf libpairtwo-*-dist.zip
|
2019-06-17 15:41:01 +02:00
|
|
|
|
2018-12-24 14:06:13 +01:00
|
|
|
cs: ## Fixes coding standard problems
|
|
|
|
vendor/bin/php-cs-fixer fix || true
|
|
|
|
|
|
|
|
tag: ## Creates a new signed git tag
|
|
|
|
$(if $(TAG),,$(error TAG is not defined. Pass via "make tag TAG=X.X.X"))
|
|
|
|
@echo Tagging $(TAG)
|
|
|
|
git add --all
|
2019-06-20 15:32:26 +02:00
|
|
|
git commit -m 'RELEASE: $(TAG) Release'
|
|
|
|
git tag -s $(TAG) -m 'RELEASE: $(TAG) Release'
|
|
|
|
make dist
|