25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Rebar3: Include Elixir files when making a release

This commit is contained in:
Badlop 2023-12-20 01:46:51 +01:00
parent 2d067f7498
commit dd5a198222
3 changed files with 16 additions and 5 deletions

View File

@ -125,6 +125,7 @@ ifeq ($(REBAR_ENABLE_ELIXIR),true)
ELIXIR_LIBDIR_RAW=$(shell elixir -e "IO.puts(:filename.dirname(:code.lib_dir(:elixir)))" -e ":erlang.halt") ELIXIR_LIBDIR_RAW=$(shell elixir -e "IO.puts(:filename.dirname(:code.lib_dir(:elixir)))" -e ":erlang.halt")
ELIXIR_LIBDIR=":$(ELIXIR_LIBDIR_RAW)" ELIXIR_LIBDIR=":$(ELIXIR_LIBDIR_RAW)"
EXPLICIT_ELIXIR_COMPILE=MIX_ENV=default mix compile.elixir EXPLICIT_ELIXIR_COMPILE=MIX_ENV=default mix compile.elixir
PREPARE_ELIXIR_SCRIPTS=mkdir rel/overlays; cp $(ELIXIR_LIBDIR_RAW)/../bin/iex rel/overlays/; cp $(ELIXIR_LIBDIR_RAW)/../bin/elixir rel/overlays/; sed -i 's|ERTS_BIN=$$|ERTS_BIN=$$SCRIPT_PATH/../../erts-{{erts_vsn}}/bin/|' rel/overlays/elixir
endif endif
ifeq "$(REBAR_VER)" "3" ifeq "$(REBAR_VER)" "3"
SKIPDEPS= SKIPDEPS=
@ -438,11 +439,13 @@ distclean: clean clean-rel
rm -f vars.config rm -f vars.config
rel: rel:
$(PREPARE_ELIXIR_SCRIPTS)
$(REBARREL) $(REBARREL)
DEV_CONFIG = _build/dev/rel/ejabberd/conf/ejabberd.yml DEV_CONFIG = _build/dev/rel/ejabberd/conf/ejabberd.yml
dev $(DEV_CONFIG): dev $(DEV_CONFIG):
$(PREPARE_ELIXIR_SCRIPTS)
$(REBARDEV) $(REBARDEV)
TAGS: TAGS:

View File

@ -255,6 +255,10 @@
{template, "ejabberdctl.template", "bin/ejabberdctl"}, {template, "ejabberdctl.template", "bin/ejabberdctl"},
{copy, "_build/default/lib/ejabberd/ebin/Elixir.*", "lib/ejabberd-{{release_version}}/ebin/"}, {copy, "_build/default/lib/ejabberd/ebin/Elixir.*", "lib/ejabberd-{{release_version}}/ebin/"},
{copy, "{{base_dir}}/consolidated/*", "lib/ejabberd-{{release_version}}/ebin/"}, {copy, "{{base_dir}}/consolidated/*", "lib/ejabberd-{{release_version}}/ebin/"},
{copy, "rel/overlays/iex", "releases/{{release_version}}/"},
{if_var_true, elixir,
{template, "rel/overlays/elixir", "releases/{{release_version}}/elixir"}
},
{copy, "inetrc", "conf/inetrc"}, {copy, "inetrc", "conf/inetrc"},
{copy, "tools/captcha*.sh", "lib/ejabberd-\{\{release_version\}\}/priv/bin/"}, {copy, "tools/captcha*.sh", "lib/ejabberd-\{\{release_version\}\}/priv/bin/"},
{copy, "rel/files/install_upgrade.escript", "bin/install_upgrade.escript"}]} {copy, "rel/files/install_upgrade.escript", "bin/install_upgrade.escript"}]}

View File

@ -1,13 +1,17 @@
Vars = case file:consult(filename:join([filename:dirname(SCRIPT), "..", "vars.config"])) of {Vars, ElixirApps} = case file:consult(filename:join([filename:dirname(SCRIPT), "..", "vars.config"])) of
{ok, Terms} -> {ok, Terms} ->
Backends = [mssql, mysql, odbc, pgsql, redis, sqlite], Backends = [mssql, mysql, odbc, pgsql, redis, sqlite],
EBs = lists:filter(fun(Backend) -> lists:member({Backend, true}, Terms) end, Backends), EBs = lists:filter(fun(Backend) -> lists:member({Backend, true}, Terms) end, Backends),
[lists:keyfind(description, 1, Terms), Elixirs = case lists:keyfind(elixir, 1, Terms) of
{elixir, true} -> [elixir, iex, logger, mix];
_ -> []
end,
{[lists:keyfind(description, 1, Terms),
lists:keyfind(vsn, 1, Terms), lists:keyfind(vsn, 1, Terms),
{env, [{enabled_backends, EBs}]} {env, [{enabled_backends, EBs}]}
]; ], Elixirs};
_Err -> _Err ->
[] {[], []}
end, end,
{application, ejabberd, {application, ejabberd,
@ -27,7 +31,7 @@ Vars = case file:consult(filename:join([filename:dirname(SCRIPT), "..", "vars.co
pkix, pkix,
stringprep, stringprep,
yconf, yconf,
xmpp]}, xmpp | ElixirApps]},
{mod, {ejabberd_app, []}}]}. {mod, {ejabberd_app, []}}]}.
%% Local Variables: %% Local Variables: