mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 03:00:17 +00:00
Only compile relevant plugin sources
This commit is contained in:
parent
4fe651cb5b
commit
00b3d9d3cc
1 changed files with 7 additions and 1 deletions
|
@ -406,7 +406,13 @@ load_plugin_modules(Config, Modules) ->
|
||||||
Dir ->
|
Dir ->
|
||||||
Dir
|
Dir
|
||||||
end,
|
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],
|
Loaded = [load_plugin(Src) || Src <- Sources],
|
||||||
FilterMissing = is_missing_plugin(Loaded),
|
FilterMissing = is_missing_plugin(Loaded),
|
||||||
NotLoaded = [V || V <- Modules, FilterMissing(V)],
|
NotLoaded = [V || V <- Modules, FilterMissing(V)],
|
||||||
|
|
Loading…
Reference in a new issue