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

Commit 8f086e3

Browse files
committed
mk/rabbitmq-hexpm.mk: Extract plugin from rabbitmq-build.mk
This is necessary to load rabbitmq-hexpm.mk after erlang.mk. This should fix the publish to Hex.pm.
1 parent 6f47134 commit 8f086e3

File tree

4 files changed

+54
-50
lines changed

4 files changed

+54
-50
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ ERLANG_MK_COMMIT = rabbitmq-tmp
4040
include mk/rabbitmq-components.mk
4141
include mk/rabbitmq-build.mk
4242
include erlang.mk
43+
include mk/rabbitmq-hexpm.mk
4344
include mk/rabbitmq-dist.mk
4445
include mk/rabbitmq-tools.mk
4546

mk/rabbitmq-build.mk

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -87,53 +87,3 @@ ifdef JENKINS_HOME
8787
CT_OPTS += -ct_hooks cth_surefire
8888
export RABBITMQ_CT_SKIP_AS_ERROR = true
8989
endif
90-
91-
# --------------------------------------------------------------------
92-
# Hex.pm.
93-
# --------------------------------------------------------------------
94-
95-
.PHONY: hex-publish hex-publish-docs
96-
97-
HEXPM_URL = https://github.com/rabbitmq/hexpm-cli/releases/download/v0.1.0/hexpm
98-
HEXPM_CLI = $(ERLANG_MK_TMP)/hexpm
99-
100-
$(HEXPM_CLI):
101-
$(gen_verbose) $(call core_http_get,$@,$(HEXPM_URL))
102-
$(verbose) chmod +x $@
103-
104-
rebar.config: dep_rabbit_common = hex $(PROJECT_VERSION)
105-
rebar.config: dep_amqp_client = hex $(PROJECT_VERSION)
106-
107-
define RABBITMQ_HEXPM_DEFAULT_FILES
108-
"erlang.mk",
109-
"git-revisions.txt",
110-
"include",
111-
"LICENSE*",
112-
"Makefile",
113-
"rabbitmq-components.mk",
114-
"README",
115-
"README.md",
116-
"src"
117-
endef
118-
119-
hex-publish: $(HEXPM_CLI) app rebar.config
120-
$(gen_verbose) echo "$(PROJECT_DESCRIPTION) $(PROJECT_VERSION)" \
121-
> git-revisions.txt
122-
ifneq ($(PROJECT),rabbit_common)
123-
$(verbose) mv rabbitmq-components.mk rabbitmq-components.mk.not-hexpm
124-
$(verbose) cp \
125-
$(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.hexpm.mk \
126-
rabbitmq-components.mk
127-
$(verbose) touch -r rabbitmq-components.mk.not-hexpm \
128-
rabbitmq-components.mk
129-
endif
130-
$(verbose) trap '\
131-
rm -f git-revisions.txt rebar.lock; \
132-
if test -f rabbitmq-components.mk.not-hexpm; then \
133-
mv rabbitmq-components.mk.not-hexpm rabbitmq-components.mk; \
134-
fi' EXIT INT; \
135-
$(HEXPM_CLI) publish
136-
137-
hex-publish-docs: $(HEXPM_CLI) app docs
138-
$(gen_verbose) trap 'rm -f rebar.lock' EXIT INT; \
139-
$(HEXPM_CLI) docs

mk/rabbitmq-hexpm.mk

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# --------------------------------------------------------------------
2+
# Hex.pm.
3+
# --------------------------------------------------------------------
4+
5+
.PHONY: hex-publish hex-publish-docs
6+
7+
HEXPM_URL = https://github.com/rabbitmq/hexpm-cli/releases/download/v0.1.0/hexpm
8+
HEXPM_CLI = $(ERLANG_MK_TMP)/hexpm
9+
10+
$(HEXPM_CLI):
11+
$(gen_verbose) $(call core_http_get,$@,$(HEXPM_URL))
12+
$(verbose) chmod +x $@
13+
14+
rebar.config: dep_rabbit_common = hex $(PROJECT_VERSION)
15+
rebar.config: dep_amqp_client = hex $(PROJECT_VERSION)
16+
17+
define RABBITMQ_HEXPM_DEFAULT_FILES
18+
"erlang.mk",
19+
"git-revisions.txt",
20+
"include",
21+
"LICENSE*",
22+
"Makefile",
23+
"rabbitmq-components.mk",
24+
"README",
25+
"README.md",
26+
"src"
27+
endef
28+
29+
hex-publish: $(HEXPM_CLI) app rebar.config
30+
$(gen_verbose) echo "$(PROJECT_DESCRIPTION) $(PROJECT_VERSION)" \
31+
> git-revisions.txt
32+
ifneq ($(PROJECT),rabbit_common)
33+
$(verbose) mv rabbitmq-components.mk rabbitmq-components.mk.not-hexpm
34+
$(verbose) cp \
35+
$(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.hexpm.mk \
36+
rabbitmq-components.mk
37+
$(verbose) touch -r rabbitmq-components.mk.not-hexpm \
38+
rabbitmq-components.mk
39+
endif
40+
$(verbose) trap '\
41+
rm -f git-revisions.txt rebar.lock; \
42+
if test -f rabbitmq-components.mk.not-hexpm; then \
43+
mv rabbitmq-components.mk.not-hexpm rabbitmq-components.mk; \
44+
fi' EXIT INT; \
45+
$(HEXPM_CLI) publish
46+
47+
hex-publish-docs: $(HEXPM_CLI) app docs
48+
$(gen_verbose) trap 'rm -f rebar.lock' EXIT INT; \
49+
$(HEXPM_CLI) docs

mk/rabbitmq-plugin.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ ifeq ($(filter rabbitmq-build.mk,$(notdir $(MAKEFILE_LIST))),)
22
include $(dir $(lastword $(MAKEFILE_LIST)))rabbitmq-build.mk
33
endif
44

5+
ifeq ($(filter rabbitmq-hexpm.mk,$(notdir $(MAKEFILE_LIST))),)
6+
include $(dir $(lastword $(MAKEFILE_LIST)))rabbitmq-hexpm.mk
7+
endif
8+
59
ifeq ($(filter rabbitmq-dist.mk,$(notdir $(MAKEFILE_LIST))),)
610
include $(dir $(lastword $(MAKEFILE_LIST)))rabbitmq-dist.mk
711
endif

0 commit comments

Comments
 (0)