summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Hueras <zhueras@chitika.com>2016-02-09 10:34:04 -0500
committerZachary Hueras <zhueras@chitika.com>2016-02-09 10:34:04 -0500
commitedd032c5f5f1ded195298de67a81d8264c802e6b (patch)
tree9b4902d4f84299f32cd36a24630c680fbdec15f0
parent61ce3eaa3e1d4d5cef3f05e1aafba2e2c9f70ef5 (diff)
Include hook for app compilation
-rw-r--r--src/rebar_prv_compile.erl11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/rebar_prv_compile.erl b/src/rebar_prv_compile.erl
index 136d6b3..effc763 100644
--- a/src/rebar_prv_compile.erl
+++ b/src/rebar_prv_compile.erl
@@ -14,6 +14,7 @@
-define(PROVIDER, compile).
-define(ERLC_HOOK, erlc_compile).
+-define(APP_HOOK, app_compile).
-define(DEPS, [lock]).
%% ===================================================================
@@ -121,11 +122,13 @@ compile(State, Providers, AppInfo) ->
rebar_erlc_compiler:compile(AppInfo2),
AppInfo3 = rebar_hooks:run_all_hooks(AppDir, post, ?ERLC_HOOK, Providers, AppInfo2, State),
- case rebar_otp_app:compile(State, AppInfo3) of
- {ok, AppInfo4} ->
- AppInfo5 = rebar_hooks:run_all_hooks(AppDir, post, ?PROVIDER, Providers, AppInfo4, State),
+ AppInfo4 = rebar_hooks:run_all_hooks(AppDir, pre, ?APP_HOOK, Providers, AppInfo3, State),
+ case rebar_otp_app:compile(State, AppInfo4) of
+ {ok, AppInfo5} ->
+ AppInfo6 = rebar_hooks:run_all_hooks(AppDir, post, ?APP_HOOK, Providers, AppInfo5, State),
+ AppInfo7 = rebar_hooks:run_all_hooks(AppDir, post, ?PROVIDER, Providers, AppInfo6, State),
has_all_artifacts(AppInfo5),
- AppInfo5;
+ AppInfo7;
Error ->
throw(Error)
end.