diff options
author | Tristan Sloughter <t@crashfast.com> | 2015-08-15 14:57:18 -0500 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2015-08-16 13:02:26 -0500 |
commit | cf22c7e941bceae8c53ec8160c4311a47676c913 (patch) | |
tree | 2d4378a06a58ca073a28580e106766c66d7fcdaa /src/rebar_prv_install_deps.erl | |
parent | 642897867eddf00a7b1a9bf3ca99c0851b287db0 (diff) |
track the parent of umbrella app dependencies
Diffstat (limited to 'src/rebar_prv_install_deps.erl')
-rw-r--r-- | src/rebar_prv_install_deps.erl | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl index e521b25..74de109 100644 --- a/src/rebar_prv_install_deps.erl +++ b/src/rebar_prv_install_deps.erl @@ -37,6 +37,8 @@ -export([handle_deps_as_profile/4, parse_deps/5, + parse_deps/6, + profile_dep_dir/2, find_cycles/1, cull_compile/2]). @@ -155,10 +157,11 @@ deps_per_profile(Profiles, Upgrade, State) -> handle_profile_pkg_level(PkgDeps1, AllApps, Seen, Upgrade, Locks, State1). parse_profile_deps(State, Profile, Level) -> - DepsDir = profile_dep_dir(State, Profile), + %DepsDir = profile_dep_dir(State, Profile), Locks = rebar_state:get(State, {locks, Profile}, []), - Deps = rebar_state:get(State, {deps, Profile}, []), - {SrcDeps, PkgDeps} = parse_deps(DepsDir, Deps, State, Locks, Level), + %Deps = rebar_state:get(State, {deps, Profile}, []), + %{SrcDeps, PkgDeps} = parse_deps(DepsDir, Deps, State, Locks, Level), + {SrcDeps, PkgDeps} = rebar_state:get(State, {parsed_deps, Profile}, {[], []}), {{Profile, SrcDeps, Locks, Level}, {Profile, Level, PkgDeps}}. %% Level-order traversal of all dependencies, across profiles. @@ -373,12 +376,21 @@ handle_dep(AppInfo, Profile, SrcDeps, PkgDeps, SrcApps, Level, State, Locks) -> -spec handle_dep(rebar_state:t(), atom(), file:filename_all(), rebar_app_info:t(), list(), integer()) -> {rebar_app_info:t(), [rebar_app_info:t()], [pkg_dep()], [integer()], rebar_state:t()}. handle_dep(State, Profile, DepsDir, AppInfo, Locks, Level) -> + Parent = rebar_app_info:parent(AppInfo), Profiles = rebar_state:current_profiles(State), Name = rebar_app_info:name(AppInfo), - C = rebar_config:consult(rebar_app_info:dir(AppInfo)), + %% Deps may be under a sub project app, find it and use its state if so + S = case ec_lists:find(fun(X) -> + Parent =:= rebar_app_info:name(X) + end, rebar_state:project_apps(State)) of + {ok, ParentApp} -> + rebar_app_info:state(ParentApp); + error -> + rebar_app_info:state(AppInfo) + end, - S = rebar_app_info:state(AppInfo), + C = rebar_config:consult(rebar_app_info:dir(AppInfo)), S1 = rebar_state:new(S, C, rebar_app_info:dir(AppInfo)), S2 = rebar_state:apply_overrides(S1, Name), |