Fix regression caused by 252b31f (#90)

This commit is contained in:
Tuncer Ayaz 2013-11-27 15:12:46 +01:00
parent 39c38b6141
commit a8a415aed4

View file

@ -502,6 +502,8 @@ acc_modules([Module | Rest], Command, Config, File, Acc) ->
%% %%
plugin_modules(Config, PredirsAssoc) -> plugin_modules(Config, PredirsAssoc) ->
Modules = lists:flatten(rebar_config:get_all(Config, plugins)), Modules = lists:flatten(rebar_config:get_all(Config, plugins)),
?DEBUG("Plugins requested while processing ~s: ~p~n",
[rebar_utils:get_cwd(), Modules]),
plugin_modules(Config, PredirsAssoc, ulist(Modules)). plugin_modules(Config, PredirsAssoc, ulist(Modules)).
ulist(L) -> ulist(L) ->
@ -543,6 +545,7 @@ plugin_modules(Config, PredirsAssoc, FoundModules, MissingModules) ->
load_plugin_modules(Config, PredirsAssoc, Modules) -> load_plugin_modules(Config, PredirsAssoc, Modules) ->
Cwd = rebar_utils:get_cwd(), Cwd = rebar_utils:get_cwd(),
PluginDirs = get_all_plugin_dirs(Config, Cwd, PredirsAssoc), PluginDirs = get_all_plugin_dirs(Config, Cwd, PredirsAssoc),
?DEBUG("Plugin dirs for ~s:~n~p~n", [Cwd, PluginDirs]),
%% Find relevant sources in base_dir and plugin_dir %% Find relevant sources in base_dir and plugin_dir
Erls = string:join([atom_to_list(M)++"\\.erl" || M <- Modules], "|"), Erls = string:join([atom_to_list(M)++"\\.erl" || M <- Modules], "|"),
@ -558,7 +561,9 @@ load_plugin_modules(Config, PredirsAssoc, Modules) ->
{Loaded, NotLoaded}. {Loaded, NotLoaded}.
get_all_plugin_dirs(Config, Cwd, PredirsAssoc) -> get_all_plugin_dirs(Config, Cwd, PredirsAssoc) ->
get_plugin_dir(Config, Cwd) ++ get_base_plugin_dirs(Cwd, PredirsAssoc). [rebar_utils:get_cwd()]
++ get_plugin_dir(Config, Cwd)
++ get_base_plugin_dirs(Cwd, PredirsAssoc).
get_plugin_dir(Config, Cwd) -> get_plugin_dir(Config, Cwd) ->
case rebar_config:get_local(Config, plugin_dir, undefined) of case rebar_config:get_local(Config, plugin_dir, undefined) of