diff --git a/rebar.config.script b/rebar.config.script new file mode 100644 index 0000000..314f3b5 --- /dev/null +++ b/rebar.config.script @@ -0,0 +1,9 @@ +case os:getenv("TARGET_ERLANG_VERSION") of + false -> CONFIG; + [] -> CONFIG; + TargetErlangVersionString -> + GpbOpts = proplists:get_value(gpb_opts, CONFIG), + TargetErlangVersion = {target_erlang_version, list_to_integer(TargetErlangVersionString)}, + NewGpbOpts = lists:keystore(target_erlang_version, 1, GpbOpts, TargetErlangVersion), + lists:keystore(gpb_opts, 1, CONFIG, {gpb_opts, NewGpbOpts}) +end. diff --git a/src/hex_api_release.erl b/src/hex_api_release.erl index 2f2f906..0963748 100644 --- a/src/hex_api_release.erl +++ b/src/hex_api_release.erl @@ -106,7 +106,7 @@ publish(Config, Tarball) -> publish(Config, Tarball, []). %% }}} %% ''' %% @end --spec publish(hexcore:config(), binary(), publish_params()) -> hex_api:response(). +-spec publish(hex_core:config(), binary(), publish_params()) -> hex_api:response(). publish(Config, Tarball, Params) when is_map(Config) andalso is_binary(Tarball) andalso is_list(Params)-> QueryString = hex_api:encode_query_string([{replace, proplists:get_value(replace, Params, false)}]), Path = hex_api:join_path_segments(hex_api:build_repository_path(Config, ["publish"])), diff --git a/src/hex_http.erl b/src/hex_http.erl index 04994dc..bed9e9d 100644 --- a/src/hex_http.erl +++ b/src/hex_http.erl @@ -7,7 +7,9 @@ -type method() :: get | post | put | patch | delete. -type status() :: non_neg_integer(). +-export_type([status/0]). -type headers() :: #{binary() => binary()}. +-export_type([headers/0]). -type body() :: {ContentType :: binary(), Body :: binary()} | undefined. -type adapter_config() :: map(). diff --git a/src/hex_registry.erl b/src/hex_registry.erl index 4f82e69..b9e8974 100644 --- a/src/hex_registry.erl +++ b/src/hex_registry.erl @@ -14,8 +14,8 @@ ]). -include_lib("public_key/include/public_key.hrl"). --type private_key() :: public_key:rsa_private_key() | binary(). --type public_key() :: public_key:rsa_public_key() | binary(). +-type private_key() :: #'RSAPrivateKey'{} | binary(). +-type public_key() :: #'RSAPublicKey'{} | binary(). %%==================================================================== %% API functions