From a7639fd4ad459aad5ad2d8fbe3b8c9414e5d4350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Mon, 15 Jan 2018 12:31:47 +0100 Subject: Call configure on deps in separate rebar command that compile This way we rebar.config.script can use vars detected by configure --- plugins/configure_deps.erl | 5 +++++ plugins/override_opts.erl | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 plugins/configure_deps.erl (limited to 'plugins') diff --git a/plugins/configure_deps.erl b/plugins/configure_deps.erl new file mode 100644 index 000000000..181da0b02 --- /dev/null +++ b/plugins/configure_deps.erl @@ -0,0 +1,5 @@ +-module(configure_deps). +-export(['configure-deps'/2]). + +'configure-deps'(Config, Vals) -> + {ok, Config}. diff --git a/plugins/override_opts.erl b/plugins/override_opts.erl index df875c556..1d321fc87 100644 --- a/plugins/override_opts.erl +++ b/plugins/override_opts.erl @@ -2,13 +2,13 @@ -export([preprocess/2]). override_opts(override, Config, Opts) -> - lists:foldl(fun({Opt, [Value]}, Conf) -> + lists:foldl(fun({Opt, Value}, Conf) -> rebar_config:set(Conf, Opt, Value) end, Config, Opts); override_opts(add, Config, Opts) -> - lists:foldl(fun({Opt, [Value]}, Conf) -> + lists:foldl(fun({Opt, Value}, Conf) -> V = rebar_config:get_local(Conf, Opt, []), - rebar_config:set(Conf, Opt, [Value | V]) + rebar_config:set(Conf, Opt, V ++ Value) end, Config, Opts). preprocess(Config, _Dirs) -> -- cgit v1.2.3