mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 11:06:20 +00:00
Made OTP app module validation optional
This commit is contained in:
parent
1bf45036dc
commit
93f77b50fc
1 changed files with 11 additions and 2 deletions
|
@ -35,7 +35,7 @@
|
||||||
%% Public API
|
%% Public API
|
||||||
%% ===================================================================
|
%% ===================================================================
|
||||||
|
|
||||||
compile(_Config, File) ->
|
compile(Config, File) ->
|
||||||
%% If we get an .app.src file, it needs to be pre-processed and
|
%% If we get an .app.src file, it needs to be pre-processed and
|
||||||
%% written out as a ebin/*.app file. That resulting file will then
|
%% written out as a ebin/*.app file. That resulting file will then
|
||||||
%% be validated as usual.
|
%% be validated as usual.
|
||||||
|
@ -50,7 +50,16 @@ compile(_Config, File) ->
|
||||||
case rebar_app_utils:load_app_file(AppFile) of
|
case rebar_app_utils:load_app_file(AppFile) of
|
||||||
{ok, AppName, AppData} ->
|
{ok, AppName, AppData} ->
|
||||||
validate_name(AppName, AppFile),
|
validate_name(AppName, AppFile),
|
||||||
|
|
||||||
|
%% In general, the list of modules is an important thing to validate
|
||||||
|
%% for compliance with OTP guidelines and upgrade procedures. However,
|
||||||
|
%% some people prefer not to validate this list.
|
||||||
|
case rebar_config:get_local(Config, validate_app_modules, true) of
|
||||||
|
true ->
|
||||||
validate_modules(AppName, proplists:get_value(modules, AppData));
|
validate_modules(AppName, proplists:get_value(modules, AppData));
|
||||||
|
false ->
|
||||||
|
ok
|
||||||
|
end;
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
?ABORT("Failed to load app file ~s: ~p\n", [AppFile, Reason])
|
?ABORT("Failed to load app file ~s: ~p\n", [AppFile, Reason])
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Reference in a new issue