diff --git a/rel/reltool.config.script b/rel/reltool.config.script new file mode 100644 index 000000000..1ab7a9c01 --- /dev/null +++ b/rel/reltool.config.script @@ -0,0 +1,20 @@ +%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- +%% ex: ft=erlang ts=4 sw=4 et + +Sys = proplists:get_value(sys, CONFIG), +IncludeApps = [App || {app, App, _} <- Sys], + +[DepsDir] = proplists:get_value(lib_dirs, Sys), +DepApps = lists:map(fun(AppFile) -> + {ok, [{application, Name, Attrs}]} + = file:consult(filename:join(DepsDir, AppFile)), + Name + end, filelib:wildcard("*/ebin/*.app", DepsDir)), +AppendApps = DepApps -- IncludeApps, +Cond = [{mod_cond, app}, {incl_cond, include}], + +NewSys = lists:append(Sys, [{app, App, Cond} || App <- AppendApps]), + +io:format("~p~n", [NewSys]), + +lists:keyreplace(sys, 1, CONFIG, {sys, NewSys}).