VSN = case os:getenv("KZ_VERSION") of 'false' -> os:cmd("echo -n $(scripts/next_version 2>/dev/null)"); Version -> Version end, ToName = fun (App) -> list_to_atom(hd(string:tokens(App,"-"))) end, Apps = [list_to_atom(App) || "applications/"++App = Dir <- filelib:wildcard("applications/*"), filelib:is_dir(Dir)], Core = [list_to_atom(App) || "core/"++App = Dir <- filelib:wildcard( "core/*"), filelib:is_dir(Dir)], Deps = [list_to_atom(App) || "deps/"++App = Dir <- filelib:wildcard( "deps/*"), filelib:is_dir(Dir)], ToFilterOut = [rabbitmq_codegen ,'.erlang.mk' ,'ci.erlang.mk' ,'.settings' ,skel ,parse_trans ,meck ], Preparer = fun (List) -> [{E,load} || E <- List, not lists:member(E, ToFilterOut)] end, Base = [tools ,sasl ,eunit ,common_test ], BASE = [{default_release, {kazoo, VSN}} ,{release, {kazoo, VSN} ,Base ++ Preparer(Apps ++ Core ++ Deps) }], APPS = [begin {ok, [{application, App, Settings}]} = file:consult(list_to_binary(["applications/", atom_to_list(App), "/ebin/", atom_to_list(App), ".app"])), AppDeps = proplists:get_value(applications, Settings, []), {release, {App, VSN}, Base ++ Preparer(AppDeps)} end || App <- Apps, not lists:member(App, ToFilterOut) ], CONFIG ++ BASE ++ APPS.