forked from 2600hz/kazoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.relx.config.script
54 lines (47 loc) · 1.72 KB
/
dev.relx.config.script
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
49
50
51
52
53
VSN = case os:getenv("KZ_VERSION") of
'false' ->
[C || C <- os:cmd("scripts/next_version 2>/dev/null"), C =/= $\n];
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
,'kazoo_slack'
,'exml'
,'escalus'
,'ananke'
,'amqp_cron'
,'amqp_leader'
,'amqp_dist'
],
Preparer = fun (List) -> [{E,load} || E <- List, not lists:member(E, ToFilterOut)] end,
Base = [runtime_tools
,tools
,wx
,observer
,debugger
,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.