diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-06-08 19:44:57 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-06-08 19:44:57 +0200 |
commit | fbd2778c04ba10ab9f7d1aebffc8c4ef96aef1bd (patch) | |
tree | c86b28856c4b4f5f87688025ba38d2d48f3b56c4 | |
parent | ca3368a6b4910c8d7e23cd8c6a5a7136fbe2ca35 (diff) |
Deprecate xrl_opts/yrl_opts fail_on_warning opt
-rw-r--r-- | include/rebar.hrl | 8 | ||||
-rw-r--r-- | src/rebar_erlc_compiler.erl | 15 | ||||
-rw-r--r-- | src/rebar_utils.erl | 14 |
3 files changed, 18 insertions, 19 deletions
diff --git a/include/rebar.hrl b/include/rebar.hrl index 82821e6..e870f98 100644 --- a/include/rebar.hrl +++ b/include/rebar.hrl @@ -11,8 +11,8 @@ -define(FMT(Str, Args), lists:flatten(io_lib:format(Str, Args))). --define(DEPRECATED(Old, New, Opts, When), - rebar_utils:deprecated(Old, New, Opts, When)). +-define(DEPRECATED(Key, Old, New, Opts, When), + rebar_utils:deprecated(Key, Old, New, Opts, When)). --define(DEPRECATED(Old, New, When), - rebar_utils:deprecated(Old, New, When)). +-define(DEPRECATED(Key, Old, New, When), + rebar_utils:deprecated(Key, Old, New, When)). diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl index fe06cbf..8b63321 100644 --- a/src/rebar_erlc_compiler.erl +++ b/src/rebar_erlc_compiler.erl @@ -70,13 +70,12 @@ -spec compile(Config::rebar_config:config(), AppFile::file:filename()) -> 'ok'. compile(Config, _AppFile) -> - %% TODO: enable as soon as OTP patch has been accepted - %% ?DEPRECATED(fail_on_warning, warnings_as_errors, - %% rebar_config:get_list(Config, xrl_opts, []), - %% "once R15 is released"), - %% ?DEPRECATED(fail_on_warning, warnings_as_errors, - %% rebar_config:get_list(Config, yrl_opts, []), - %% "once R15 is released"), + ?DEPRECATED(xrl_opts, fail_on_warning, warnings_as_errors, + rebar_config:get_list(Config, xrl_opts, []), + "once R14B04 is released"), + ?DEPRECATED(yrl_opts, fail_on_warning, warnings_as_errors, + rebar_config:get_list(Config, yrl_opts, []), + "once R14B04 is released"), rebar_base_compiler:run(Config, check_files(rebar_config:get_local( @@ -299,7 +298,7 @@ compile_xrl_yrl(Source, Target, Opts, Mod) -> {ok, _, []} -> ok; {ok, _, _Warnings} -> - %% TODO: remove once R15 is released + %% TODO: remove once R14B04 is released case lists:member(fail_on_warning, Opts) of true -> ?FAIL; diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index ebf6656..f18621b 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -41,7 +41,7 @@ find_executable/1, prop_check/3, expand_code_path/0, - deprecated/3, deprecated/4]). + deprecated/4, deprecated/5]). -include("rebar.hrl"). @@ -261,19 +261,19 @@ emulate_escript_foldl(Fun, Acc, File) -> Error end. -deprecated(Old, New, Opts, When) -> +deprecated(Key, Old, New, Opts, When) -> case lists:member(Old, Opts) of true -> - deprecated(Old, New, When); + deprecated(Key, Old, New, When); false -> ok end. -deprecated(Old, New, When) -> +deprecated(Key, Old, New, When) -> io:format( << - "WARNING: option deprecated~n" - "Config option '~p' has been deprecated~n" + "WARNING: deprecated ~p option used~n" + "Option '~p' has been deprecated~n" "in favor of '~p'.~n" "'~p' will be removed ~s.~n~n" - >>, [Old, New, Old, When]). + >>, [Key, Old, New, Old, When]). |