diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-08-26 18:20:05 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-08-29 17:27:45 +0200 |
commit | 00b3d9d3cc10e955cda1a93473d507472d59dde7 (patch) | |
tree | bf07b954d7de7ad539a2fb1e314b7a7521537f9b | |
parent | 4fe651cb5b973fa555b62213d74f2caf23bb306e (diff) |
Only compile relevant plugin sources
-rw-r--r-- | src/rebar_core.erl | 8 |
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)], |