summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathaniel Waisbrot <code@waisbrot.net>2016-04-13 23:19:44 -0400
committerNathaniel Waisbrot <code@waisbrot.net>2016-04-13 23:19:44 -0400
commit45c9975a6d790d40d80acdb001121123e3f410dd (patch)
tree03bbc2ac6e245725b097e6ea4650d98bc5284b41
parent8fe2d0c8a4601955665a8955906b70bbbb9767de (diff)
Add a provider hook for edoc
Allows `pre_hooks` and `post_hooks` to fire for the `edoc` provider.
-rw-r--r--src/rebar_prv_edoc.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rebar_prv_edoc.erl b/src/rebar_prv_edoc.erl
index e7048b6..6cefe14 100644
--- a/src/rebar_prv_edoc.erl
+++ b/src/rebar_prv_edoc.erl
@@ -32,13 +32,19 @@ init(State) ->
do(State) ->
code:add_pathsa(rebar_state:code_paths(State, all_deps)),
ProjectApps = rebar_state:project_apps(State),
+ Providers = rebar_state:providers(State),
EDocOpts = rebar_state:get(State, edoc_opts, []),
+ Cwd = rebar_state:dir(State),
+ rebar_hooks:run_all_hooks(Cwd, pre, ?PROVIDER, Providers, State),
lists:foreach(fun(AppInfo) ->
+ rebar_hooks:run_all_hooks(Cwd, pre, ?PROVIDER, Providers, AppInfo, State),
AppName = ec_cnv:to_list(rebar_app_info:name(AppInfo)),
?INFO("Running edoc for ~s", [AppName]),
AppDir = rebar_app_info:dir(AppInfo),
- ok = edoc:application(list_to_atom(AppName), AppDir, EDocOpts)
+ ok = edoc:application(list_to_atom(AppName), AppDir, EDocOpts),
+ rebar_hooks:run_all_hooks(Cwd, post, ?PROVIDER, Providers, AppInfo, State)
end, ProjectApps),
+ rebar_hooks:run_all_hooks(Cwd, post, ?PROVIDER, Providers, State),
rebar_utils:cleanup_code_path(rebar_state:code_paths(State, default)),
{ok, State}.