-
Notifications
You must be signed in to change notification settings - Fork 34
/
Makefile
48 lines (36 loc) · 1.36 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
PROJECT = rabbitmq_message_deduplication
PROJ_VSN = $(shell $(MIX) eval 'Mix.Project.config()[:version] |> IO.puts()')
DEPS = rabbit_common rabbit
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_ARCHIVE = $(shell ls plugins/elixir-*.ez)
PROJECT_ARCHIVE = $(shell ls plugins/$(PROJECT)-*.ez)
EXTRA_DIST_EZS = $(ELIXIR_ARCHIVE) $(PROJECT_ARCHIVE)
app:: $(elixir_srcs) deps
$(MIX) make_app
dist:: app
mkdir -p $(DIST_DIR)
MIX_ENV=prod $(MIX) archive.build.elixir
MIX_ENV=prod $(MIX) archive.build -o $(DIST_DIR)/$(PROJECT)-$(PROJ_VSN).ez
cp -r _build/$(MIX_ENV)/archives/elixir-*.ez $(DIST_DIR)
test-build:: app
mkdir -p $(DIST_DIR)
$(MIX) archive.build.elixir
$(MIX) archive.build -o $(DIST_DIR)/$(PROJECT)-$(PROJ_VSN).ez
cp -r _build/$(MIX_ENV)/archives/elixir-*.ez $(DIST_DIR)
tests:: $(elixir_srcs) deps
MIX_ENV=test $(MIX) make_tests
clean::
@rm -fr _build
# erlang.mk modules
include rabbitmq-components.mk
include erlang.mk