summaryrefslogtreecommitdiff
path: root/src/rebar_prv_install_deps.erl
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-04-05 08:52:57 -0500
committerTristan Sloughter <t@crashfast.com>2015-04-05 08:52:57 -0500
commit79e2d6006c989a241d4599d048ff39f094f9e886 (patch)
treee7caacaba07013911b2b2ad4bff400812dd02a70 /src/rebar_prv_install_deps.erl
parent019152e1d5e23e60f734e8d14309ea7ed45b01fc (diff)
install each deps plugins after handling dep, instead of at the end
Diffstat (limited to 'src/rebar_prv_install_deps.erl')
-rw-r--r--src/rebar_prv_install_deps.erl14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl
index 851cbf2..db2b036 100644
--- a/src/rebar_prv_install_deps.erl
+++ b/src/rebar_prv_install_deps.erl
@@ -85,10 +85,7 @@ do(State) ->
no_cycle ->
case compile_order(Source, ProjectApps) of
{ok, ToCompile} ->
- %% Deps may have plugins to install. Find and intall here.
- {ok, PluginProviders, State2} = rebar_plugins:install(State1),
- State3 = rebar_state:create_logic_providers(PluginProviders, State2),
- {ok, rebar_state:deps_to_build(State3, ToCompile)};
+ {ok, rebar_state:deps_to_build(State1, ToCompile)};
{error, Error} ->
{error, Error}
end
@@ -339,13 +336,13 @@ handle_upgrade(AppInfo, SrcDeps, PkgDeps, SrcApps, Level, State, Locks) ->
handle_dep(AppInfo, SrcDeps, PkgDeps, SrcApps, Level, State, Locks) ->
DepsDir = rebar_dir:deps_dir(State),
- {AppInfo1, NewSrcDeps, NewPkgDeps, NewLocks} =
+ {AppInfo1, NewSrcDeps, NewPkgDeps, NewLocks, State1} =
handle_dep(State, DepsDir, AppInfo, Locks, Level),
AppInfo2 = rebar_app_info:dep_level(AppInfo1, Level),
{NewSrcDeps ++ SrcDeps
,NewPkgDeps++PkgDeps
,[AppInfo2 | SrcApps]
- ,State
+ ,State1
,NewLocks}.
-spec handle_dep(rebar_state:t(), file:filename_all(), rebar_app_info:t(), list(), integer()) ->
@@ -362,13 +359,16 @@ handle_dep(State, DepsDir, AppInfo, Locks, Level) ->
S3 = rebar_state:apply_overrides(S2, Name),
AppInfo1 = rebar_app_info:state(AppInfo, S3),
+ %% Dep may have plugins to install. Find and install here.
+ State1 = rebar_plugins:handle_plugins(rebar_state:get(S3, plugins, []), State),
+
Deps = rebar_state:get(S3, deps, []),
%% Upgrade lock level to be the level the dep will have in this dep tree
NewLocks = [{DepName, Source, LockLevel+Level} ||
{DepName, Source, LockLevel} <- rebar_state:get(S3, {locks, default}, [])],
AppInfo2 = rebar_app_info:deps(AppInfo1, rebar_state:deps_names(Deps)),
{SrcDeps, PkgDeps} = parse_deps(DepsDir, Deps, S3, Locks, Level),
- {AppInfo2, SrcDeps, PkgDeps, Locks++NewLocks}.
+ {AppInfo2, SrcDeps, PkgDeps, Locks++NewLocks, State1}.
-spec maybe_fetch(rebar_app_info:t(), boolean() | {true, binary(), integer()},
sets:set(binary()), rebar_state:t()) -> boolean().