summaryrefslogtreecommitdiff
path: root/src/rebar_core.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_core.erl')
-rw-r--r--src/rebar_core.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rebar_core.erl b/src/rebar_core.erl
index 7740ca6..5e7848f 100644
--- a/src/rebar_core.erl
+++ b/src/rebar_core.erl
@@ -406,7 +406,13 @@ load_plugin_modules(Config, Modules) ->
Dir ->
Dir
end,
- Sources = rebar_utils:find_files(PluginDir, ".*\.erl\$"),
+
+ %% Find relevant sources
+ Erls = string:join([atom_to_list(M)++"\\.erl" || M <- Modules], "|"),
+ RE = ".*" ++ Erls ++ "\$",
+ Sources = rebar_utils:find_files(PluginDir, RE),
+
+ %% Compile and load plugins
Loaded = [load_plugin(Src) || Src <- Sources],
FilterMissing = is_missing_plugin(Loaded),
NotLoaded = [V || V <- Modules, FilterMissing(V)],