25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-10 15:47:30 +01:00
xmpp.chapril.org-ejabberd/src/ejabberd.app.src.script

57 lines
1.8 KiB
Plaintext
Raw Normal View History

{Vars, ElixirApps} = case file:consult(filename:join([filename:dirname(SCRIPT), "..", "vars.config"])) of
{ok, Terms} ->
Backends = [mssql, mysql, odbc, pgsql, redis, sqlite],
EBs = lists:filter(fun(Backend) -> lists:member({Backend, true}, Terms) end, Backends),
Elixirs = case lists:keyfind(elixir, 1, Terms) of
{elixir, true} -> [elixir, iex, logger, mix];
_ -> []
end,
ProfileEnvironmentVariable = os:getenv("REBAR_PROFILE"),
AsProfiles = case lists:dropwhile(fun("as") -> false; (_) -> true end,
init:get_plain_arguments()) of
["as", Profiles | _] -> string:split(Profiles, ",");
_ -> []
end,
Terms2 = case lists:member("dev", [ProfileEnvironmentVariable | AsProfiles]) of
true -> lists:keystore(tools, 1, Terms, {tools, true});
false -> Terms
end,
Tools = case lists:keyfind(tools, 1, Terms2) of
{tools, true} -> [observer];
_ -> []
end,
{[lists:keyfind(description, 1, Terms),
lists:keyfind(vsn, 1, Terms),
{env, [{enabled_backends, EBs}]}
], Elixirs ++ Tools};
_Err ->
{[], []}
end,
{application, ejabberd,
Vars ++
[{modules, []},
{registered, []},
{applications, [kernel, sasl, ssl, stdlib, syntax_tools]},
{included_applications,
[compiler, inets, mnesia, os_mon,
cache_tab,
eimp,
fast_tls,
2021-06-25 12:32:40 +02:00
fast_xml,
fast_yaml,
2021-06-25 12:32:40 +02:00
p1_acme,
p1_utils,
pkix,
2021-06-25 12:32:40 +02:00
stringprep,
yconf,
xmpp | ElixirApps]},
{mod, {ejabberd_app, []}}]}.
%% Local Variables:
%% mode: erlang
%% End:
%% vim: set filetype=erlang tabstop=8: