Call configure on deps in separate rebar command that compile

This way we rebar.config.script can use vars detected by configure
pull/2238/head
Paweł Chmielowski 5 years ago
parent 99f8e58eaf
commit a7639fd4ad
  1. 1
      Makefile.in
  2. 5
      plugins/configure_deps.erl
  3. 6
      plugins/override_opts.erl
  4. 3
      rebar.config
  5. 4
      rebar.config.script

@ -97,6 +97,7 @@ deps/.got:
$(REBAR) get-deps && :> deps/.got
deps/.built: deps/.got
$(REBAR) recursive-deps
$(REBAR) compile && :> deps/.built
src: deps/.built

@ -0,0 +1,5 @@
-module(configure_deps).
-export(['configure-deps'/2]).
'configure-deps'(Config, Vals) ->
{ok, Config}.

@ -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) ->

@ -111,7 +111,7 @@
{if_rebar3, {plugins, [rebar3_hex, {provider_asn1, "0.2.0"}]}}.
{if_not_rebar3, {plugins, [
deps_erl_opts, override_deps_versions, override_opts,
deps_erl_opts, override_deps_versions, override_opts, configure_deps,
{if_var_true, elixir, rebar_elixir_compiler},
{if_var_true, elixir, rebar_exunit}
]}}.
@ -153,6 +153,7 @@
{if_version_above, "17", {cover_enabled, true}}.
{cover_export_enabled, true}.
{recursive_cmds, ['configure-deps']}.
{post_hook_configure, [{"fast_tls", []},
{"stringprep", []},

@ -298,8 +298,8 @@ GenDepsConfigure =
fun(Hooks) ->
lists:map(fun({Pkg, Flags}) ->
DepPath = ResolveDepPath("deps/" ++ Pkg ++ "/"),
{add, list_to_atom(Pkg), [{pre_hooks, [{'compile',
lists:flatten(GenDepConfigureLine(DepPath, Flags))}]}]}
Line = lists:flatten(GenDepConfigureLine(DepPath, Flags)),
{add, list_to_atom(Pkg), [{pre_hooks, [{'compile', Line}, {'configure-deps', Line}]}]}
end, Hooks)
end,

Loading…
Cancel
Save