summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rebar_plugins.erl2
-rw-r--r--src/rebar_prv_compile.erl15
2 files changed, 8 insertions, 9 deletions
diff --git a/src/rebar_plugins.erl b/src/rebar_plugins.erl
index d03ada0..6d0a4dc 100644
--- a/src/rebar_plugins.erl
+++ b/src/rebar_plugins.erl
@@ -63,7 +63,7 @@ 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).
+ rebar_prv_compile:compile(S, [], AppInfo).
plugin_providers({Plugin, _, _}) when is_atom(Plugin) ->
validate_plugin(Plugin);
diff --git a/src/rebar_prv_compile.erl b/src/rebar_prv_compile.erl
index 1dff4d8..5a2e379 100644
--- a/src/rebar_prv_compile.erl
+++ b/src/rebar_prv_compile.erl
@@ -6,7 +6,7 @@
do/1,
format_error/1]).
--export([compile/2]).
+-export([compile/3]).
-include("rebar.hrl").
@@ -82,18 +82,17 @@ build_app(State, Providers, AppInfo) ->
AppState
end,
- %% Legacy hook support
- rebar_hooks:run_all_hooks(AppDir, pre, ?PROVIDER, Providers, S),
- AppInfo1 = compile(S, AppInfo),
- rebar_hooks:run_all_hooks(AppDir, post, ?PROVIDER, Providers, S),
+ compile(S, Providers, AppInfo).
- AppInfo1.
-
-compile(State, AppInfo) ->
+compile(State, Providers, AppInfo) ->
?INFO("Compiling ~s", [rebar_app_info:name(AppInfo)]),
+ AppDir = rebar_app_info:dir(AppInfo),
+ rebar_hooks:run_all_hooks(AppDir, pre, ?PROVIDER, Providers, State),
+
rebar_erlc_compiler:compile(State, ec_cnv:to_list(rebar_app_info:out_dir(AppInfo))),
case rebar_otp_app:compile(State, AppInfo) of
{ok, AppInfo1} ->
+ rebar_hooks:run_all_hooks(AppDir, post, ?PROVIDER, Providers, State),
AppInfo1;
Error ->
throw(Error)