summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2017-12-04 17:13:55 -0500
committerGitHub <noreply@github.com>2017-12-04 17:13:55 -0500
commit2a349a7446f5020ef57eb6e5862ccc480d405e3d (patch)
treea03c39047b7c1bbf529d1f30e5889b43089e21bc /src
parent1f57efcd5c787a71bbc1237dd2b1f99610593286 (diff)
parentfb67eb0ee95b2f03dc6c51535ab4b18ea70d315f (diff)
Merge pull request #1681 from ferd/fix-plugin-paths-again
Fix Plugin path handling (again!)
Diffstat (limited to 'src')
-rw-r--r--src/rebar_plugins.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rebar_plugins.erl b/src/rebar_plugins.erl
index 1fc01ff..57c34bc 100644
--- a/src/rebar_plugins.erl
+++ b/src/rebar_plugins.erl
@@ -96,8 +96,8 @@ handle_plugin(Profile, Plugin, State, Upgrade) ->
ToBuild = rebar_prv_install_deps:cull_compile(Sorted, []),
%% Add already built plugin deps to the code path
- CodePaths = [rebar_app_info:ebin_dir(A) || A <- Apps -- ToBuild],
- code:add_pathsa(CodePaths),
+ PreBuiltPaths = [rebar_app_info:ebin_dir(A) || A <- Apps] -- ToBuild,
+ code:add_pathsa(PreBuiltPaths),
%% Build plugin and its deps
[build_plugin(AppInfo, Apps, State2) || AppInfo <- ToBuild],
@@ -105,10 +105,12 @@ handle_plugin(Profile, Plugin, State, Upgrade) ->
%% Add newly built deps and plugin to code path
State3 = rebar_state:update_all_plugin_deps(State2, Apps),
NewCodePaths = [rebar_app_info:ebin_dir(A) || A <- ToBuild],
+ AllPluginEbins = filelib:wildcard(filename:join([rebar_dir:plugins_dir(State), "*", "ebin"])),
+ CodePaths = PreBuiltPaths++(AllPluginEbins--ToBuild),
code:add_pathsa(NewCodePaths++CodePaths),
%% Store plugin code paths so we can remove them when compiling project apps
- State4 = rebar_state:update_code_paths(State3, all_plugin_deps, CodePaths++NewCodePaths),
+ State4 = rebar_state:update_code_paths(State3, all_plugin_deps, PreBuiltPaths++NewCodePaths),
{plugin_providers(Plugin), State4}
catch