diff --git a/rebar.config.sample b/rebar.config.sample index 9870017..ca164fd 100644 --- a/rebar.config.sample +++ b/rebar.config.sample @@ -8,18 +8,6 @@ %% Additional library directories to add to the code path {lib_dirs, []}. -%% Command to run before compiling -{compile_pre_script, "./script.sh"}. - -%% Command to run after compiling -{compile_post_script, "./script.sh"}. - -%% Command to run before cleaning -{clean_pre_script, "./script.sh"}. - -%% Command to run after cleaning -{clean_post_script, "./script.sh"}. - %% == Erlang Compiler == %% Erlang files to compile before the rest. Rebar automatically compiles @@ -54,14 +42,6 @@ %% more info. Default is `[]' {port_envs, []}. -%% Tuple which specifies a pre-compilation script to run, and a filename that -%% exists as a result of the script running. -{port_pre_script, {"script.sh", "skipfile"}}. - -%% String that specifies a script to run during cleanup. Use this to remove -%% files/directories created by port_pre_script. -{port_cleanup_script, "cleanup.sh"}. - %% Custom name of the port driver .so file. Defaults to `_drv.so'. {so_name, "driver.so"}. 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" + >>, []).