diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2017-08-09 19:37:42 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-09 19:37:42 -0400 |
commit | 2939110eb85bed0dd494bf0ddeb4c07f5e46bfc7 (patch) | |
tree | 5fc13885062ce117713e80f3d44df033073d8363 /src/rebar_app_utils.erl | |
parent | ffd09708fff15f9c33ec42e00c17d4b000f7ff8d (diff) | |
parent | 1c96de5e10bd51ba4da9a89c087c191a8c7cd8c5 (diff) |
Merge pull request #1596 from ferd/local-apps-override-deps
Allow top-level apps to take precedence over deps
Diffstat (limited to 'src/rebar_app_utils.erl')
-rw-r--r-- | src/rebar_app_utils.erl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/rebar_app_utils.erl b/src/rebar_app_utils.erl index 9422240..1d7ef5b 100644 --- a/src/rebar_app_utils.erl +++ b/src/rebar_app_utils.erl @@ -34,6 +34,7 @@ validate_application_info/2, parse_deps/5, parse_deps/6, + expand_deps_sources/2, dep_to_app/7, format_error/1]). @@ -227,7 +228,7 @@ dep_to_app(Parent, DepsDir, Name, Vsn, Source, IsLock, State) -> not_found -> rebar_app_info:new(Parent, Name, Vsn, Dir, []) end, - update_source(AppInfo0, Source, State) + rebar_app_info:source(AppInfo0, Source) end, C = rebar_config:consult(rebar_app_info:dir(AppInfo)), AppInfo1 = rebar_app_info:update_opts(AppInfo, rebar_app_info:opts(AppInfo), C), @@ -238,6 +239,13 @@ dep_to_app(Parent, DepsDir, Name, Vsn, Source, IsLock, State) -> AppInfo5 = rebar_app_info:profiles(AppInfo4, [default]), rebar_app_info:is_lock(AppInfo5, IsLock). +%% @doc Takes a given application app_info record along with the project. +%% If the app is a package, resolve and expand the package definition. +-spec expand_deps_sources(rebar_app_info:t(), rebar_state:t()) -> + rebar_app_info:t(). +expand_deps_sources(Dep, State) -> + update_source(Dep, rebar_app_info:source(Dep), State). + %% @doc sets the source for a given dependency or app along with metadata %% around version if required. -spec update_source(rebar_app_info:t(), Source, rebar_state:t()) -> |