diff --git a/Doxyfile b/Doxyfile index 289846a..c57ce44 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = libpairtwo # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = v1.1 +PROJECT_NUMBER = $(VERSIONTAG) # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/Makefile b/Makefile index 7fe8be3..69472f9 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ .PHONY: help tests dist .DEFAULT_GOAL := help +BRANCH := $(shell git rev-parse --abbrev-ref HEAD) +VERSION := $(if $(VERSION),$(VERSION),$(BRANCH)) help: @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-12s\033[0m %s\n", $$1, $$2}' @@ -14,7 +16,7 @@ view-coverage: ## Shows the code coverage report open build/coverage/index.html api: ## Generates api-docs - doxygen + VERSIONTAG=$(VERSION) doxygen dist: ## Generates distribution touch .libpairtwo-dist @@ -26,7 +28,7 @@ dist: ## Generates distribution rm dist/composer.json rm dist/composer.lock mv dist/composer-dist-installed.json dist/composer.json - doxygen + VERSIONTAG=$(VERSION) doxygen mkdir -p dist/doc cp -r doc/api dist/doc cd dist && zip -r ../libpairtwo-dist *