summaryrefslogtreecommitdiff
path: root/src/rebar_erlc_compiler.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_erlc_compiler.erl')
-rw-r--r--src/rebar_erlc_compiler.erl26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index efbdf09..6567f06 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -70,9 +70,13 @@
-spec compile(Config::rebar_config:config(), AppFile::file:filename()) -> 'ok'.
compile(Config, _AppFile) ->
- ?DEPRECATED(fail_on_warning, warnings_as_errors,
- rebar_config:get_list(Config, erl_opts, []),
- "once OTP R14B03 is released"),
+ %% 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"),
rebar_base_compiler:run(Config,
check_files(rebar_config:get_local(
@@ -252,17 +256,6 @@ internal_erl_compile(Source, Config, Outdir, ErlOpts) ->
case compile:file(Source, Opts) of
{ok, _, []} ->
ok;
- {ok, _, _Warnings} ->
- %% We got at least one warning -- if fail_on_warning
- %% is in options, fail
- case lists:member(fail_on_warning, Opts) of
- true ->
- %% remove target to prevent overlooking this failure
- ok = file:delete(Target),
- ?FAIL;
- false ->
- ok
- end;
_ ->
?FAIL
end;
@@ -287,14 +280,14 @@ compile_mib(Source, Target, Config) ->
Config::rebar_config:config()) -> 'ok'.
compile_xrl(Source, Target, Config) ->
Opts = [{scannerfile, Target}, {return, true}
- |rebar_config:get(Config, xrl_opts, [])],
+ | rebar_config:get(Config, xrl_opts, [])],
compile_xrl_yrl(Source, Target, Opts, leex).
-spec compile_yrl(Source::file:filename(), Target::file:filename(),
Config::rebar_config:config()) -> 'ok'.
compile_yrl(Source, Target, Config) ->
Opts = [{parserfile, Target}, {return, true}
- |rebar_config:get(Config, yrl_opts, [])],
+ | rebar_config:get(Config, yrl_opts, [])],
compile_xrl_yrl(Source, Target, Opts, yecc).
-spec compile_xrl_yrl(Source::file:filename(), Target::file:filename(),
@@ -306,6 +299,7 @@ compile_xrl_yrl(Source, Target, Opts, Mod) ->
{ok, _, []} ->
ok;
{ok, _, _Warnings} ->
+ %% TODO: remove once R15 is released
case lists:member(fail_on_warning, Opts) of
true ->
?FAIL;