mirror of
https://github.com/correl/rebar.git
synced 2025-01-05 11:08:16 +00:00
Add fail_on_warning support for LFE
This commit is contained in:
parent
3db8f585f1
commit
5049da8ec4
1 changed files with 8 additions and 4 deletions
|
@ -41,12 +41,11 @@ compile(Config, _AppFile) ->
|
||||||
rebar_base_compiler:run(Config, FirstFiles, "src", ".lfe", "ebin", ".beam",
|
rebar_base_compiler:run(Config, FirstFiles, "src", ".lfe", "ebin", ".beam",
|
||||||
fun compile_lfe/3).
|
fun compile_lfe/3).
|
||||||
|
|
||||||
|
|
||||||
%% ===================================================================
|
%% ===================================================================
|
||||||
%% Internal functions
|
%% Internal functions
|
||||||
%% ===================================================================
|
%% ===================================================================
|
||||||
|
|
||||||
compile_lfe(Source, _Target, Config) ->
|
compile_lfe(Source, Target, Config) ->
|
||||||
case code:which(lfe_comp) of
|
case code:which(lfe_comp) of
|
||||||
non_existing ->
|
non_existing ->
|
||||||
?CONSOLE(
|
?CONSOLE(
|
||||||
|
@ -59,9 +58,14 @@ compile_lfe(Source, _Target, Config) ->
|
||||||
?FAIL;
|
?FAIL;
|
||||||
_ ->
|
_ ->
|
||||||
Opts = [{i, "include"}, {outdir, "ebin"}, report, return] ++
|
Opts = [{i, "include"}, {outdir, "ebin"}, report, return] ++
|
||||||
rebar_config:get_list(Config, lfe_opts, []),
|
rebar_config:get_list(Config, erl_opts, []),
|
||||||
case lfe_comp:file(Source,Opts) of
|
case lfe_comp:file(Source, Opts) of
|
||||||
{ok, _, []} -> ok;
|
{ok, _, []} -> ok;
|
||||||
|
{ok, _, _Warnings} ->
|
||||||
|
case lists:member(fail_on_warning, Opts) of
|
||||||
|
true -> file:delete(Target), ?FAIL;
|
||||||
|
false -> ok
|
||||||
|
end;
|
||||||
_ -> ?FAIL
|
_ -> ?FAIL
|
||||||
end
|
end
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Reference in a new issue