From 4ceb9e07a3408469c9a9f23203358868823779e0 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Wed, 23 Feb 2011 19:45:44 +0100 Subject: Deprecate old hooks --- src/rebar_port_compiler.erl | 17 +++++++++++++++++ src/rebar_post_script.erl | 18 ++++++++++++++++++ src/rebar_pre_script.erl | 18 ++++++++++++++++++ 3 files changed, 53 insertions(+) (limited to 'src') diff --git a/src/rebar_port_compiler.erl b/src/rebar_port_compiler.erl index b230af1..a281b29 100644 --- a/src/rebar_port_compiler.erl +++ b/src/rebar_port_compiler.erl @@ -182,6 +182,15 @@ run_precompile_hook(Config, Env) -> undefined -> ok; {Script, BypassFileName} -> + ?CONSOLE( + << + "WARNING: option deprecated~n" + "Config option 'port_pre_script' has been deprecated " + "in favor of ~n{pre_hooks, [{compile, \"script\"}]}." + "~nskipfile support has also been removed. Add skipfile" + " logic to the~nscript instead.~nFuture builds of rebar" + " will remove the option 'port_pre_script'.~n~n" + >>, []), case filelib:is_regular(BypassFileName) of false -> ?CONSOLE("Running ~s\n", [Script]), @@ -198,6 +207,14 @@ run_cleanup_hook(Config) -> undefined -> ok; Script -> + ?CONSOLE( + << + "WARNING: option deprecated~n" + "Config option 'port_pre_script' has been deprecated " + "in favor of ~n{post_hooks, [{clean, \"script\"}]}." + "~nFuture builds of rebar will remove the option " + "'port_pre_script'.~n~n" + >>, []), ?CONSOLE("Running ~s\n", [Script]), {ok, _} = rebar_utils:sh(Script, []), ok diff --git a/src/rebar_post_script.erl b/src/rebar_post_script.erl index c7f2d01..39185a9 100644 --- a/src/rebar_post_script.erl +++ b/src/rebar_post_script.erl @@ -51,6 +51,24 @@ execute_post_script(Config, Key) -> undefined -> ok; Script -> + deprecated(Key), {ok, _} = rebar_utils:sh(Script, []), ok end. + +deprecated(compile_post_script) -> + ?CONSOLE( + << + "WARNING: option deprecated~n" + "Config option 'compile_post_script' has been deprecated in favor" + " of ~noption {post_hooks, [{compile, \"script\"}]}.~nFuture builds " + "of rebar will remove the option 'compile_post_script'.~n~n" + >>, []); +deprecated(clean_post_script) -> + ?CONSOLE( + << + "WARNING: option deprecated~n" + "Config option 'clean_post_script' has been deprecated in favor" + " of ~noption {post_hooks, [{clean, \"script\"}]}.~nFuture builds " + "of rebar will remove the option 'clean_post_script'.~n~n" + >>, []). diff --git a/src/rebar_pre_script.erl b/src/rebar_pre_script.erl index 9097807..b23f469 100644 --- a/src/rebar_pre_script.erl +++ b/src/rebar_pre_script.erl @@ -51,6 +51,24 @@ execute_pre_script(Config, Key) -> undefined -> ok; Script -> + deprecated(Key), {ok, _} = rebar_utils:sh(Script, []), ok end. + +deprecated(compile_pre_script) -> + ?CONSOLE( + << + "WARNING: option deprecated~n" + "Config option 'compile_pre_script' has been deprecated in favor" + " of ~n{pre_hooks, [{compile, \"script\"}]}.~nFuture builds of" + " rebar will remove the option 'compile_pre_script'.~n~n" + >>, []); +deprecated(clean_pre_script) -> + ?CONSOLE( + << + "WARNING: option deprecated~n" + "Config option 'clean_pre_script' has been deprecated in favor" + " of ~n{pre_hooks, [{clean, \"script\"}]}.~nFuture builds of" + " rebar will remove the option 'clean_pre_script'.~n~n" + >>, []). -- cgit v1.1