Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Commit a480f2a

Browse files
committed
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]
1 parent c82162e commit a480f2a

File tree

3 files changed

+32
-12
lines changed

3 files changed

+32
-12
lines changed

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
PROJECT = rabbitmq_auth_backend_http
2+
PROJECT_DESCRIPTION = RabbitMQ HTTP Authentication Backend
3+
PROJECT_MOD = rabbit_auth_backend_http_app
24

5+
define PROJECT_ENV
6+
[
7+
{http_method, get},
8+
{user_path, "http://localhost:8000/auth/user"},
9+
{vhost_path, "http://localhost:8000/auth/vhost"},
10+
{resource_path, "http://localhost:8000/auth/resource"}
11+
]
12+
endef
13+
14+
LOCAL_DEPS = inets
315
DEPS = rabbit_common rabbit amqp_client
416

517
DEP_PLUGINS = rabbit_common/mk/rabbitmq-plugin.mk

rabbitmq-components.mk

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@ ifeq ($(.DEFAULT_GOAL),)
55
.DEFAULT_GOAL = all
66
endif
77

8+
# PROJECT_VERSION defaults to:
9+
# 1. the version exported by rabbitmq-server-release;
10+
# 2. the version stored in `git-revisions.txt`, if it exists;
11+
# 3. a version based on git-describe(1), if it is a Git clone;
12+
# 4. 0.0.0
13+
14+
PROJECT_VERSION = $(RABBITMQ_VERSION)
15+
16+
ifeq ($(PROJECT_VERSION),)
17+
PROJECT_VERSION := $(shell \
18+
if test -f git-revisions.txt; then \
19+
head -n1 git-revisions.txt | \
20+
awk '{print $$$(words $(PROJECT_DESCRIPTION) version);}'; \
21+
else \
22+
(git describe --dirty --abbrev=7 --tags --always --first-parent \
23+
2>/dev/null || echo rabbitmq_v0_0_0) | \
24+
sed -e 's/rabbitmq_v//' -e 's/_/./g' -e 's/-/+/' -e 's/-/./g'; \
25+
fi)
26+
endif
27+
828
# --------------------------------------------------------------------
929
# RabbitMQ components.
1030
# --------------------------------------------------------------------

src/rabbitmq_auth_backend_http.app.src

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)