From 00b3d9d3cc10e955cda1a93473d507472d59dde7 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Fri, 26 Aug 2011 18:20:05 +0200 Subject: [PATCH] Only compile relevant plugin sources --- src/rebar_core.erl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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)],