From aaa94f3d42b16096893556e826214042b93d61b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 31 Dec 2018 11:12:04 +0100 Subject: Add skeleton compatibility for semver versions For now, ~> is expanded to a full version only. --- core/deps.mk | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/deps.mk b/core/deps.mk index e870de0..c81323a 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -325,13 +325,22 @@ define dep_autopatch_rebar.erl false end end, + SemVsn = fun + ("~> " ++ S) -> + case length([ok || $$. <- S]) of + 0 -> S ++ ".0.0"; + 1 -> S ++ ".0"; + _ -> S + end; + (S) -> S + end, fun() -> File = case lists:keyfind(deps, 1, Conf) of false -> []; {_, Deps} -> [begin case case Dep of N when is_atom(N) -> GetHexVsn(N); - {N, S} when is_atom(N), is_list(S) -> {N, {hex, S}}; + {N, S} when is_atom(N), is_list(S) -> {N, {hex, SemVsn(S)}}; {_, S, {pkg, N}} -> {N, {hex, S}}; {N, S} when is_tuple(S) -> {N, S}; {N, _, S} -> {N, S}; -- cgit v1.2.3