|
@ -70,9 +70,13 @@ |
|
|
|
|
|
|
|
|
-spec compile(Config::rebar_config:config(), AppFile::file:filename()) -> 'ok'. |
|
|
-spec compile(Config::rebar_config:config(), AppFile::file:filename()) -> 'ok'. |
|
|
compile(Config, _AppFile) -> |
|
|
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, |
|
|
rebar_base_compiler:run(Config, |
|
|
check_files(rebar_config:get_local( |
|
|
check_files(rebar_config:get_local( |
|
@ -252,17 +256,6 @@ internal_erl_compile(Source, Config, Outdir, ErlOpts) -> |
|
|
case compile:file(Source, Opts) of |
|
|
case compile:file(Source, Opts) of |
|
|
{ok, _, []} -> |
|
|
{ok, _, []} -> |
|
|
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 |
|
|
?FAIL |
|
|
end; |
|
|
end; |
|
@ -287,14 +280,14 @@ compile_mib(Source, Target, Config) -> |
|
|
Config::rebar_config:config()) -> 'ok'. |
|
|
Config::rebar_config:config()) -> 'ok'. |
|
|
compile_xrl(Source, Target, Config) -> |
|
|
compile_xrl(Source, Target, Config) -> |
|
|
Opts = [{scannerfile, Target}, {return, true} |
|
|
Opts = [{scannerfile, Target}, {return, true} |
|
|
|rebar_config:get(Config, xrl_opts, [])], |
|
|
|
|
|
|
|
|
| rebar_config:get(Config, xrl_opts, [])], |
|
|
compile_xrl_yrl(Source, Target, Opts, leex). |
|
|
compile_xrl_yrl(Source, Target, Opts, leex). |
|
|
|
|
|
|
|
|
-spec compile_yrl(Source::file:filename(), Target::file:filename(), |
|
|
-spec compile_yrl(Source::file:filename(), Target::file:filename(), |
|
|
Config::rebar_config:config()) -> 'ok'. |
|
|
Config::rebar_config:config()) -> 'ok'. |
|
|
compile_yrl(Source, Target, Config) -> |
|
|
compile_yrl(Source, Target, Config) -> |
|
|
Opts = [{parserfile, Target}, {return, true} |
|
|
Opts = [{parserfile, Target}, {return, true} |
|
|
|rebar_config:get(Config, yrl_opts, [])], |
|
|
|
|
|
|
|
|
| rebar_config:get(Config, yrl_opts, [])], |
|
|
compile_xrl_yrl(Source, Target, Opts, yecc). |
|
|
compile_xrl_yrl(Source, Target, Opts, yecc). |
|
|
|
|
|
|
|
|
-spec compile_xrl_yrl(Source::file:filename(), Target::file:filename(), |
|
|
-spec compile_xrl_yrl(Source::file:filename(), Target::file:filename(), |
|
@ -306,6 +299,7 @@ compile_xrl_yrl(Source, Target, Opts, Mod) -> |
|
|
{ok, _, []} -> |
|
|
{ok, _, []} -> |
|
|
ok; |
|
|
ok; |
|
|
{ok, _, _Warnings} -> |
|
|
{ok, _, _Warnings} -> |
|
|
|
|
|
%% TODO: remove once R15 is released |
|
|
case lists:member(fail_on_warning, Opts) of |
|
|
case lists:member(fail_on_warning, Opts) of |
|
|
true -> |
|
|
true -> |
|
|
?FAIL; |
|
|
?FAIL; |
|
|