25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-10-05 14:51:05 +02:00

Call configure on deps in separate rebar command that compile

This way we rebar.config.script can use vars detected by configure
This commit is contained in:
Paweł Chmielowski 2018-01-15 12:31:47 +01:00
parent 99f8e58eaf
commit a7639fd4ad
5 changed files with 13 additions and 6 deletions

View File

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

View File

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

View File

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

View File

@ -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", []},

View File

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