summaryrefslogtreecommitdiff
path: root/src/rebar_plugins.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_plugins.erl')
-rw-r--r--src/rebar_plugins.erl13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/rebar_plugins.erl b/src/rebar_plugins.erl
index b7d81e2..000ccdc 100644
--- a/src/rebar_plugins.erl
+++ b/src/rebar_plugins.erl
@@ -13,20 +13,23 @@
install(State) ->
%% Set deps_dir to a different dir for plugin so they don't collide
- DepsDir = rebar_state:get(State, deps_dir, ?DEFAULT_DEPS_DIR),
+ OldDepsDir = rebar_state:get(State, deps_dir, ?DEFAULT_DEPS_DIR),
State1 = rebar_state:set(State, deps_dir, ?DEFAULT_PLUGINS_DIR),
- expand_plugins(?DEFAULT_PLUGINS_DIR),
+ DepsDir = rebar_dir:deps_dir(State1),
+ expand_plugins(DepsDir),
Plugins = rebar_state:get(State1, plugins, []),
PluginProviders = rebar_utils:filtermap(fun(Plugin) ->
handle_plugin(Plugin, State1)
end, Plugins),
- {ok, PluginProviders, rebar_state:set(State1, deps_dir, DepsDir)}.
+ State2 = rebar_state:set(State1, deps_dir, OldDepsDir),
+ {ok, PluginProviders, State2}.
+-spec handle_plugin(rebar_prv_install_deps:dep(), rebar_state:t()) -> {true, any()} | false.
handle_plugin(Plugin, State) ->
try
- {ok, State1} = rebar_prv_install_deps:handle_deps(State, [Plugin]),
- Apps = rebar_state:get(State1, all_deps, []),
+ {ok, _, State1} = rebar_prv_install_deps:handle_deps(State, [Plugin]),
+ Apps = rebar_state:all_deps(State1),
ToBuild = lists:dropwhile(fun rebar_app_info:valid/1, Apps),
lists:foreach(fun(AppInfo) ->
AppDir = rebar_app_info:dir(AppInfo),