Browse Source

Only suppress deprecation warnings on OTP 23

For OTP 19 and earlier compatibility.
pull/2191/head
Michael Klishin 5 years ago
parent
commit
b93bb35819
No known key found for this signature in database GPG Key ID: E80EDCFA0CDB21EE
3 changed files with 17 additions and 5 deletions
  1. +5
    -1
      src/r3_hex_api.erl
  2. +6
    -2
      src/rebar_git_resource.erl
  3. +6
    -2
      src/rebar_utils.erl

+ 5
- 1
src/r3_hex_api.erl View File

@ -28,7 +28,11 @@ put(Config, Path, Body) ->
delete(Config, Path) ->
request(Config, delete, Path, undefined).
-compile({nowarn_deprecated_function, [{http_uri, encode, 1}]}).
-ifdef (OTP_RELEASE).
-if(?OTP_RELEASE >= 23).
-compile({nowarn_deprecated_function, [{http_uri, encode, 1}]}).
-endif.
-endif.
%% @private
encode_query_string(List) ->

+ 6
- 2
src/rebar_git_resource.erl View File

@ -100,8 +100,12 @@ compare_url(Dir, Url) ->
?DEBUG("Comparing git url ~p with ~p", [ParsedUrl, ParsedCurrentUrl]),
ParsedCurrentUrl =:= ParsedUrl.
-compile({nowarn_deprecated_function, [{http_uri, parse, 2},
{http_uri, scheme_defaults, 0}]}).
-ifdef (OTP_RELEASE).
-if(?OTP_RELEASE >= 23).
-compile({nowarn_deprecated_function, [{http_uri, parse, 2},
{http_uri, scheme_defaults, 0}]}).
-endif.
-endif.
parse_git_url(Url) ->
%% Checks for standard scp style git remote

+ 6
- 2
src/rebar_utils.erl View File

@ -908,8 +908,12 @@ get_http_vars(Scheme) ->
Config = rebar_config:consult_file(GlobalConfigFile),
proplists:get_value(Scheme, Config, OS).
-compile({nowarn_deprecated_function, [{http_uri, parse, 1},
{http_uri, decode, 1}]}).
-ifdef (OTP_RELEASE).
-if(?OTP_RELEASE >= 23).
-compile({nowarn_deprecated_function, [{http_uri, parse, 1},
{http_uri, decode, 1}]}).
-endif.
-endif.
set_httpc_options() ->
set_httpc_options(https_proxy, get_http_vars(https_proxy)),

Loading…
Cancel
Save