summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuncer Ayaz <tuncer.ayaz@gmail.com>2011-08-26 18:20:05 +0200
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2011-08-29 17:27:45 +0200
commit00b3d9d3cc10e955cda1a93473d507472d59dde7 (patch)
treebf07b954d7de7ad539a2fb1e314b7a7521537f9b
parent4fe651cb5b973fa555b62213d74f2caf23bb306e (diff)
Only compile relevant plugin sources
-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)],