gmminer/rebar.config.script
Ulf Wiger 495fcb30d6 WIP: AE_DISABLE_CUCKOO env var support
revert rebar.lock to original
2019-10-31 13:03:52 +01:00

21 lines
884 B
Plaintext

%% -*- mode:erlang; erlang-indent-level:4; indent-tabs-mode:nil -*-
io:fwrite("Running ~p~n", [SCRIPT]).
case os:getenv("AE_DISABLE_CUCKOO") =/= false of
true ->
RemoveApps = [aecuckoo, aecuckooprebuilt],
RemovePlugins = [rebar_aecuckooprebuilt_dep],
{_, Deps} = lists:keyfind(deps, 1, CONFIG),
NewDeps = [D || D <- Deps,
not lists:member(element(1,D), RemoveApps)],
Plugins = proplists:get_value(plugins, CONFIG, []),
CONFIG1 = lists:keyreplace(deps, 1, CONFIG, {deps, NewDeps}),
Plugins1 = [P || P <- Plugins,
not lists:member(element(1,P), RemovePlugins)],
CONFIG2 = lists:keystore(plugins, 1, CONFIG1, {plugins, Plugins1}),
io:fwrite("CONFIG2 = ~p~n", [CONFIG2]),
CONFIG2;
false ->
io:fwrite("Using cuckoo~n", []),
CONFIG
end.