Skip to content

Commit

Permalink
KAZOO-4362: fix relx.config.script because of weird right-assoc erlan…
Browse files Browse the repository at this point in the history
…g rule
  • Loading branch information
fenollp committed Jan 26, 2016
1 parent ebc8d5b commit d8c4750
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ after_success:
- git fetch origin master:master
- files="$(git diff --name-only master... | grep -v deps/)" || true
- ./scripts/check-dialyzer.escript $files
- ERL_LIBS="$HOME/proper" make eunit
- make release
- ERL_LIBS="$HOME/proper" make eunit
- ./scripts/check-whitespace.sh core/ applications/
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,5 @@ sup_completion: kazoo
release: RELX = $(ROOT)/utils/relx/relx
release: relx.config
$(RELX) -v release --config $^ --relname kazoo_whistle_apps
# $(RELX) -v release --config $^ --relname kazoo_ecallmgr
relx.config: relx.config.script
$(ROOT)/scripts/script2any.escript relx.config.script
57 changes: 31 additions & 26 deletions relx.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,39 @@ ToName = fun (Apps) ->
[list_to_atom(hd(string:tokens(App,"-"))) || App <- Apps]
end,

Is_OTP_GE_18 = case erlang:system_info(otp_release) of
[$1,D|_] when D >= $8 -> true;
_ -> false
end,

Apps = ToName([App || "applications/"++App <- filelib:wildcard("applications/*"), App /= "Makefile"]),
Core = ToName([App || "core/"++App <- filelib:wildcard( "core/*"), App /= "Makefile"]),
Deps = ToName([App || "deps/"++App <- filelib:wildcard( "deps/*"), App /= "Makefile"]),

Base = Core
++ Apps
%% Both whistle_apps and ecallmgr include apps: whistle_amqp, sasl, crypto
-- [ecallmgr, whistle_apps]

++ Deps
%% Name is amqp_client, not rabbitmq_erlang_client
-- [rabbitmq_erlang_client] ++ [amqp_client]
%% Manually added: is a dep of RabbitMQ client
++ [rabbit_common]
%% exmpp Duplicated modules: tls specified in ssl and exmpp
-- [exmpp]
%% Name is hep, not hep_erlang
-- [hep_erlang] ++ [hep]
%% merl Part of OTP since 18
++ case erlang:system_info(otp_release) of
[$1,D|_] when D >= $8 ->
[];
_ ->
[merl]
end
%% mochiweb Duplicated modules: mochijson2 specified in rabbit_common and mochiweb
-- [mochiweb]
,
Base = [ {'++', Core}
, {'++', Apps}
%% Both whistle_apps and ecallmgr include apps: whistle_amqp, sasl, crypto
, {'--', [ecallmgr, whistle_apps]}

, {'++', Deps}
%% Name is amqp_client, not rabbitmq_erlang_client
, {'--', [rabbitmq_erlang_client]}, {'++', [amqp_client]}
%% Manually added: is a dep of RabbitMQ client
, {'++', [rabbit_common]}
%% exmpp Duplicated modules: tls specified in ssl and exmpp
, {'--', [exmpp]}
%% Name is hep, not hep_erlang
, {'--', [hep_erlang]}, {'++', [hep]}
%% merl Part of OTP since 18
, {'--', case Is_OTP_GE_18 of
true -> [merl];
false -> []
end}
%% mochiweb Duplicated modules: mochijson2 specified in rabbit_common and mochiweb
, {'--', [mochiweb]}
],
LeftAssocAsItShouldBe = fun ({Op,Arg}, Acc) -> (fun erlang:Op/2)(Acc, Arg) end,
Based = lists:foldl(LeftAssocAsItShouldBe, [], Base),


[ {lib_dirs, [ "applications"
Expand All @@ -46,11 +51,11 @@ Base = Core
%% , {sys_config, "rel/sys.config"}

, {release, {kazoo_whistle_apps,"4.0.0"}
, [whistle_apps] ++ Base
, [whistle_apps] ++ Based
}

, {release, {kazoo_ecallmgr,"4.0.0"}
, [ecallmgr] ++ Base
, [ecallmgr] ++ Based
}

].

0 comments on commit d8c4750

Please sign in to comment.