-
Notifications
You must be signed in to change notification settings - Fork 7
/
rebar.config.script
36 lines (35 loc) · 1.27 KB
/
rebar.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
%% -*- erlang -*-
%%
%% If the environment variable X_COMP is set, it is an indication that self
%% is being compiled as a dependency under exodev. Since exodev lists all
%% dependency in its root rebar.config file in order to have a flat view of
%% the dependency tree, we should nil out our local
%% deps list provided by our local rebar.config
%%
CFG1 = case os:getenv("KVDB_BACKENDS") of
Str when is_list(Str) ->
Priv = filename:join(filename:dirname(SCRIPT), "priv"),
{ok,Exclude} = file:script(
filename:join(Priv, "excluded_apps.script"),
[{'CWD', Priv}]),
Deps0 = proplists:get_value(deps, CONFIG, []),
Deps1 = [D || D <- Deps0,
not lists:member(element(1,D), Exclude)],
lists:keystore(deps, 1, CONFIG, {deps, Deps1});
false ->
io:fwrite("Using all backends~n", []),
CONFIG
end.
%% The following is a temporary fix for Feuerlabs' device SW build system
case os:getenv("EXODEV_COMP") of
E when E==false; E==[] ->
case os:getenv("REBAR_DEPS") of
D when D==false; D==[] -> CFG1;
Dir -> lists:keystore(deps_dir, 1, CFG1, {deps_dir, Dir})
end;
_ ->
case lists:keytake(deps, 1, CFG1) of
{ value, _, Remainder } -> Remainder;
_ -> CFG1
end
end.