mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 03:00:17 +00:00
Deprecate old hooks
This commit is contained in:
parent
bc98a4820e
commit
4ceb9e07a3
4 changed files with 53 additions and 20 deletions
|
@ -8,18 +8,6 @@
|
||||||
%% Additional library directories to add to the code path
|
%% Additional library directories to add to the code path
|
||||||
{lib_dirs, []}.
|
{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 Compiler ==
|
||||||
|
|
||||||
%% Erlang files to compile before the rest. Rebar automatically compiles
|
%% Erlang files to compile before the rest. Rebar automatically compiles
|
||||||
|
@ -54,14 +42,6 @@
|
||||||
%% more info. Default is `[]'
|
%% more info. Default is `[]'
|
||||||
{port_envs, []}.
|
{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 `<Application>_drv.so'.
|
%% Custom name of the port driver .so file. Defaults to `<Application>_drv.so'.
|
||||||
{so_name, "driver.so"}.
|
{so_name, "driver.so"}.
|
||||||
|
|
||||||
|
|
|
@ -182,6 +182,15 @@ run_precompile_hook(Config, Env) ->
|
||||||
undefined ->
|
undefined ->
|
||||||
ok;
|
ok;
|
||||||
{Script, BypassFileName} ->
|
{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
|
case filelib:is_regular(BypassFileName) of
|
||||||
false ->
|
false ->
|
||||||
?CONSOLE("Running ~s\n", [Script]),
|
?CONSOLE("Running ~s\n", [Script]),
|
||||||
|
@ -198,6 +207,14 @@ run_cleanup_hook(Config) ->
|
||||||
undefined ->
|
undefined ->
|
||||||
ok;
|
ok;
|
||||||
Script ->
|
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]),
|
?CONSOLE("Running ~s\n", [Script]),
|
||||||
{ok, _} = rebar_utils:sh(Script, []),
|
{ok, _} = rebar_utils:sh(Script, []),
|
||||||
ok
|
ok
|
||||||
|
|
|
@ -51,6 +51,24 @@ execute_post_script(Config, Key) ->
|
||||||
undefined ->
|
undefined ->
|
||||||
ok;
|
ok;
|
||||||
Script ->
|
Script ->
|
||||||
|
deprecated(Key),
|
||||||
{ok, _} = rebar_utils:sh(Script, []),
|
{ok, _} = rebar_utils:sh(Script, []),
|
||||||
ok
|
ok
|
||||||
end.
|
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"
|
||||||
|
>>, []).
|
||||||
|
|
|
@ -51,6 +51,24 @@ execute_pre_script(Config, Key) ->
|
||||||
undefined ->
|
undefined ->
|
||||||
ok;
|
ok;
|
||||||
Script ->
|
Script ->
|
||||||
|
deprecated(Key),
|
||||||
{ok, _} = rebar_utils:sh(Script, []),
|
{ok, _} = rebar_utils:sh(Script, []),
|
||||||
ok
|
ok
|
||||||
end.
|
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"
|
||||||
|
>>, []).
|
||||||
|
|
Loading…
Reference in a new issue