libpairtwo/Makefile
Jeroen De Meerleer 1485859f27 ENHANCEMENT: Better Docs generation
* NEW FEATURE: Added clean-dist and clean-dev targets
* ENHANCEMENT: Resized logo in Doxygen for better fit
* ENHANCEMENT: Doxygen takes branch name or version tag as `PROJECT_NUMBER`
* CHANGE: Version tag directly put in distribution filename
* CHANGE: `Tournament::GameExists()` renamed to `Tournament::gameExists()`
* CHANGE: Updated composer metadata
* CHANGE: Some setters changed to fluent setters. (More info: 7aca35057c10d2b982f93a698499c0c01df2fdc5)
2019-06-20 15:32:59 +02:00

64 lines
1.6 KiB
Makefile

.PHONY: help tests dist
.DEFAULT_GOAL := help
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
VERSION := $(if $(TAG),$(TAG),$(BRANCH))
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
api: ## Generates api-docs
VERSIONTAG=$(VERSION) doxygen
dist: ## Generates distribution
touch .libpairtwo-dist
git add .libpairtwo-dist
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
make api
mkdir -p dist/doc
cp -r doc/api dist/doc
cd dist && zip -r ../libpairtwo-$(VERSION)-dist.zip *
git reset --hard HEAD^
mv res/composer* dist/
clean: clean-dist clean-dev
clean-dev:
rm -rf doc/api
rm -rf .idea
rm -rf .libpairtwo-distro
rm -rf vendor
rm -rf composer.lock
clean-dist:
rm -rf dist/doc
rm -rf dist/vendor
rm -rf dist/composer.json
rm -rf libpairtwo-*-dist.zip
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)
chag update $(TAG)
git add --all
git commit -m 'RELEASE: $(TAG) Release'
git tag -s $(TAG) -m 'RELEASE: $(TAG) Release'
make dist