diff options
Diffstat (limited to 'src/rebar_plugins.erl')
-rw-r--r-- | src/rebar_plugins.erl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/rebar_plugins.erl b/src/rebar_plugins.erl index 45cb5c9..333d8a1 100644 --- a/src/rebar_plugins.erl +++ b/src/rebar_plugins.erl @@ -32,14 +32,7 @@ handle_plugin(Plugin, State) -> Apps = rebar_state:all_deps(State1), ToBuild = lists:dropwhile(fun rebar_app_info:valid/1, Apps), - lists:foreach(fun(AppInfo) -> - AppDir = rebar_app_info:dir(AppInfo), - C = rebar_config:consult(AppDir), - S = rebar_state:new(rebar_state:new(), C, AppDir), - rebar_prv_compile:build(S, AppInfo), - true = code:add_patha(filename:join(AppDir, "ebin")) - end, ToBuild), - + [build_plugin(AppInfo) || AppInfo <- ToBuild], plugin_providers(Plugin) catch C:T -> @@ -48,6 +41,13 @@ handle_plugin(Plugin, State) -> false end. +build_plugin(AppInfo) -> + AppDir = rebar_app_info:dir(AppInfo), + C = rebar_config:consult(AppDir), + S = rebar_state:new(rebar_state:new(), C, AppDir), + rebar_prv_compile:compile(S, AppInfo), + true = code:add_patha(filename:join(AppDir, "ebin")). + plugin_providers({Plugin, _, _}) when is_atom(Plugin) -> validate_plugin(Plugin); plugin_providers({Plugin, _}) when is_atom(Plugin) -> |