Move from .app.src to Makefile variables

This is the recommended way with Erlang.mk.

By default, the version is inherited from rabbitmq-server-release when
the source archive is created, or computed from git-describe(1) (see
`rabbitmq-components.mk`). One can override the version from the command
line by setting the `PROJECT_VERSION` variable.

[#130992027]
This commit is contained in:
Jean-Sébastien Pédron 2016-12-06 16:59:22 +01:00
parent 2902daa84c
commit 2c2dda7154
3 changed files with 29 additions and 16 deletions

View File

@ -1,4 +1,12 @@
PROJECT = rabbitmq_trust_store
PROJECT_DESCRIPTION = Client X.509 certificates trust store
PROJECT_MOD = rabbit_trust_store_app
define PROJECT_ENV
[
{default_refresh_interval, 30}
]
endef
DEPS = rabbit_common rabbit
## We need the Cowboy's test utilities

View File

@ -5,6 +5,27 @@ ifeq ($(.DEFAULT_GOAL),)
.DEFAULT_GOAL = all
endif
# PROJECT_VERSION defaults to:
# 1. the version exported by rabbitmq-server-release;
# 2. the version stored in `git-revisions.txt`, if it exists;
# 3. a version based on git-describe(1), if it is a Git clone;
# 4. 0.0.0
PROJECT_VERSION = $(RABBITMQ_VERSION)
ifeq ($(PROJECT_VERSION),)
PROJECT_VERSION := $(shell \
if test -f git-revisions.txt; then \
head -n1 git-revisions.txt | \
awk '{print $$$(words $(PROJECT_DESCRIPTION) version);}'; \
else \
(git describe --dirty --abbrev=7 --tags --always --first-parent \
2>/dev/null || echo rabbitmq_v0_0_0) | \
sed -e 's/^rabbitmq_v//' -e 's/^v//' -e 's/_/./g' -e 's/-/+/' \
-e 's/-/./g'; \
fi)
endif
# --------------------------------------------------------------------
# RabbitMQ components.
# --------------------------------------------------------------------

View File

@ -1,16 +0,0 @@
{application, rabbitmq_trust_store, [
{description, "Client certificate trust store. Provides a way to whitelist client x509 certificates."},
{vsn, ""},
{modules, []},
{registered, []},
{mod, {rabbit_trust_store_app, []}},
{env, [
{default_refresh_interval, 30}
]},
{applications, [
kernel,
stdlib,
rabbit_common,
rabbit
]}
]}.