Sfoglia il codice sorgente

move otp version verification to a single app_info function

pull/760/head
Tristan Sloughter 9 anni fa
parent
commit
a81444ae1c
3 ha cambiato i file con 9 aggiunte e 4 eliminazioni
  1. +2
    -2
      src/rebar_app_discover.erl
  2. +5
    -0
      src/rebar_app_info.erl
  3. +2
    -2
      src/rebar_prv_install_deps.erl

+ 2
- 2
src/rebar_app_discover.erl Vedi File

@ -84,8 +84,8 @@ merge_deps(AppInfo, State) ->
AppInfo1 = rebar_app_info:apply_overrides(rebar_state:get(State, overrides, []), AppInfo0),
AppInfo2 = rebar_app_info:apply_profiles(AppInfo1, CurrentProfiles),
rebar_utils:check_min_otp_version(rebar_app_info:get(AppInfo2, minimum_otp_vsn, undefined)),
rebar_utils:check_blacklisted_otp_versions(rebar_app_info:get(AppInfo2, blacklisted_otp_vsns, [])),
%% Will throw an exception if checks fail
rebar_app_info:verify_otp_vsn(AppInfo2),
State1 = lists:foldl(fun(Profile, StateAcc) ->
handle_profile(Profile, Name, AppInfo2, StateAcc)

+ 5
- 0
src/rebar_app_info.erl Vedi File

@ -53,6 +53,7 @@
valid/1,
valid/2,
verify_otp_vsn/1,
has_all_artifacts/1,
apply_overrides/2,
@ -404,6 +405,10 @@ valid(#app_info_t{valid=Valid}) ->
valid(AppInfo=#app_info_t{}, Valid) ->
AppInfo#app_info_t{valid=Valid}.
verify_otp_vsn(AppInfo) ->
rebar_utils:check_min_otp_version(rebar_app_info:get(AppInfo, minimum_otp_vsn, undefined)),
rebar_utils:check_blacklisted_otp_versions(rebar_app_info:get(AppInfo, blacklisted_otp_vsns, [])).
-spec has_all_artifacts(#app_info_t{}) -> true | {false, file:filename()}.
has_all_artifacts(AppInfo) ->
Artifacts = rebar_app_info:get(AppInfo, artifacts, []),

+ 2
- 2
src/rebar_prv_install_deps.erl Vedi File

@ -262,8 +262,8 @@ handle_dep(State, Profile, DepsDir, AppInfo, Locks, Level) ->
Plugins = rebar_app_info:get(AppInfo2, plugins, []),
AppInfo3 = rebar_app_info:set(AppInfo2, {plugins, Profile}, Plugins),
rebar_utils:check_min_otp_version(rebar_app_info:get(AppInfo3, minimum_otp_vsn, undefined)),
rebar_utils:check_blacklisted_otp_versions(rebar_app_info:get(AppInfo3, blacklisted_otp_vsns, [])),
%% Will throw an exception if checks fail
rebar_app_info:verify_otp_vsn(AppInfo3),
%% Dep may have plugins to install. Find and install here.
State1 = rebar_plugins:install(State, AppInfo3),

Caricamento…
Annulla
Salva