From d9feed54a984350d9eac4e5a5dd3bb6f1b2ea2b6 Mon Sep 17 00:00:00 2001 From: Stu Tomlinson Date: Mon, 21 Sep 2020 12:49:58 +0100 Subject: [PATCH] Add 'gitonly_deps' list to rebar config/script (#3391) Add list of dependencies that should only be built from git, to support building with rebar3 where deps do not have hex packages (or where the package versions do not directly map to git tags). This is required for elixir and luerl deps. --- rebar.config | 2 ++ rebar.config.script | 15 ++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/rebar.config b/rebar.config index 7803c0220..8ed91062a 100644 --- a/rebar.config +++ b/rebar.config @@ -61,6 +61,8 @@ {yconf, ".*", {git, "https://github.com/processone/yconf", {tag, "1.0.7"}}} ]}. +{gitonly_deps, [elixir, luerl]}. + {if_var_true, latest_deps, {floating_deps, [cache_tab, eimp, diff --git a/rebar.config.script b/rebar.config.script index c09380d75..e08eb60fe 100644 --- a/rebar.config.script +++ b/rebar.config.script @@ -196,9 +196,14 @@ AppendList2 = fun(Append) -> end, Rebar3DepsFilter = -fun(DepsList) -> - lists:map(fun({DepName, _, {git, _, {tag, Version}}}) -> - {DepName, Version}; +fun(DepsList, GitOnlyDeps) -> + lists:map(fun({DepName, _, {git, _, {tag, Version}}} = Dep) -> + case lists:member(DepName, GitOnlyDeps) of + true -> + Dep; + _ -> + {DepName, Version} + end; (Dep) -> Dep end, DepsList) @@ -367,8 +372,8 @@ Rules = [ AppendList2(ProcssXrefExclusions), [], []}, {[deps], [floating_deps], true, ProcessFloatingDeps, [], []}, - {[deps], IsRebar3, - Rebar3DepsFilter, []}, + {[deps], [gitonly_deps], IsRebar3, + Rebar3DepsFilter, [], []}, {[deps], SystemDeps /= false, GlobalDepsFilter, []} ],