-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For reasons to me unknown, the build logic was unable to package and run the plugin against the broker anymore. As the build logic is incredibly overengineerd and complicated, the following hacks were done to make it work. 1. We target against a fixed (and stable version) by switching from the main branch to the versioned one. 2. We build the `.ez` archive ourselves via `mix` and copy both the plugin and its dependencies within the `plugins` folder. 3. We override an internal variable `EXTRA_DIST_EZS` to avoid RMQ Makefiles from removing the copied plugins. This logic is brittle to say the least, I am not sure for how long I will manage to maintain this package as every time things are more complicated and less documented... Signed-off-by: Matteo Cafasso <[email protected]>
- Loading branch information
Showing
3 changed files
with
27 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,37 @@ | ||
PROJECT = rabbitmq_message_deduplication | ||
|
||
BUILD_DEPS = rabbitmq_cli | ||
DEPS = rabbit_common rabbit | ||
DEPS = rabbit_common rabbit rabbitmq_management | ||
TEST_DEPS = rabbitmq_ct_helpers rabbitmq_ct_client_helpers amqp_client | ||
|
||
DEP_PLUGINS = rabbit_common/mk/rabbitmq-plugin.mk | ||
DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-plugin.mk | ||
|
||
# Mix customizations | ||
|
||
MIX_ENV ?= dev | ||
override MIX := mix | ||
elixir_srcs := mix.exs | ||
|
||
# RMQ `dist` target removes anything within the `plugins` folder | ||
# which is not managed by erlang.mk. | ||
# We need to instruct the `rabbitmq-dist:do-dist` target to not | ||
# remove our plugin and related dependencies. | ||
ELIXIR_VERSION := $(shell elixir --version | grep Elixir | cut -d ' ' -f 2) | ||
PROJECT_VERSION := $(shell git describe --tags --abbrev=0) | ||
EXTRA_DIST_EZS := plugins/elixir-$(ELIXIR_VERSION).ez plugins/$(PROJECT)-$(PROJECT_VERSION).ez | ||
|
||
app:: $(elixir_srcs) deps | ||
$(MIX) make_all | ||
cp -r _build/$(MIX_ENV)/archives/elixir-*.ez plugins/ | ||
cp -r _build/$(MIX_ENV)/archives/$(PROJECT)-*.ez plugins/ | ||
|
||
tests:: $(elixir_srcs) deps | ||
MIX_ENV=test $(MIX) make_tests | ||
|
||
# FIXME: Use erlang.mk patched for RabbitMQ, while waiting for PRs to be | ||
# reviewed and merged. | ||
clean:: | ||
@rm -fr _build | ||
|
||
ERLANG_MK_REPO = https://github.com/rabbitmq/erlang.mk.git | ||
ERLANG_MK_COMMIT = rabbitmq-tmp | ||
# erlang.mk modules | ||
|
||
include rabbitmq-components.mk | ||
include erlang.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters