浏览代码

swich clean and compile to use macro provider in hook run

pull/319/head
Tristan Sloughter 10 年前
父节点
当前提交
40d3781104
共有 2 个文件被更改,包括 8 次插入8 次删除
  1. +4
    -4
      src/rebar_prv_clean.erl
  2. +4
    -4
      src/rebar_prv_compile.erl

+ 4
- 4
src/rebar_prv_clean.erl 查看文件

@ -50,9 +50,9 @@ do(State) ->
clean_apps(EmptyState, Providers, DepApps),
Cwd = rebar_dir:get_cwd(),
rebar_hooks:run_all_hooks(Cwd, pre, clean, Providers, State),
rebar_hooks:run_all_hooks(Cwd, pre, ?PROVIDER, Providers, State),
clean_apps(State, Providers, ProjectApps),
rebar_hooks:run_all_hooks(Cwd, post, clean, Providers, State),
rebar_hooks:run_all_hooks(Cwd, post, ?PROVIDER, Providers, State),
{ok, State}.
@ -72,9 +72,9 @@ clean_apps(State, Providers, Apps) ->
?INFO("Cleaning out ~s...", [rebar_app_info:name(AppInfo)]),
%% Legacy hook support
rebar_hooks:run_all_hooks(AppDir, pre, clean, Providers, S),
rebar_hooks:run_all_hooks(AppDir, pre, ?PROVIDER, Providers, S),
rebar_erlc_compiler:clean(State, rebar_app_info:out_dir(AppInfo)),
rebar_hooks:run_all_hooks(AppDir, post, clean, Providers, S)
rebar_hooks:run_all_hooks(AppDir, post, ?PROVIDER, Providers, S)
end, Apps).
handle_args(State) ->

+ 4
- 4
src/rebar_prv_compile.erl 查看文件

@ -36,7 +36,7 @@ do(State) ->
Deps = rebar_state:deps_to_build(State),
Cwd = rebar_dir:get_cwd(),
rebar_hooks:run_all_hooks(Cwd, pre, compile, Providers, State),
rebar_hooks:run_all_hooks(Cwd, pre, ?PROVIDER, Providers, State),
%% Need to allow global config vars used on deps
%% Right now no way to differeniate and just give deps a new state
@ -48,7 +48,7 @@ do(State) ->
State2 = rebar_state:set(rebar_state:set(State, post_hooks, []), pre_hooks, []),
ProjectApps1 = build_apps(State2, Providers, ProjectApps),
rebar_hooks:run_all_hooks(Cwd, post, compile, Providers, State),
rebar_hooks:run_all_hooks(Cwd, post, ?PROVIDER, Providers, State),
{ok, rebar_state:project_apps(State, ProjectApps1)}.
@ -75,9 +75,9 @@ build_app(State, Providers, AppInfo) ->
%% Legacy hook support
rebar_hooks:run_all_hooks(AppDir, pre, compile, Providers, S),
rebar_hooks:run_all_hooks(AppDir, pre, ?PROVIDER, Providers, S),
AppInfo1 = compile(S, AppInfo),
rebar_hooks:run_all_hooks(AppDir, post, compile, Providers, S),
rebar_hooks:run_all_hooks(AppDir, post, ?PROVIDER, Providers, S),
true = code:add_patha(rebar_app_info:ebin_dir(AppInfo1)),
AppInfo1.

正在加载...
取消
保存