diff options
author | Loïc Hoguin <[email protected]> | 2015-05-23 23:18:51 +0300 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-05-23 23:18:51 +0300 |
commit | fd9d9f7589d01c4c1046d7b2a117b76e40bd4c9c (patch) | |
tree | d2bb53b0e8bb7e3ac774a057ac7e0743a0fa57a5 | |
parent | aca4282998335d3e5238876e618224a5d4b9c627 (diff) | |
download | erlang.mk-fd9d9f7589d01c4c1046d7b2a117b76e40bd4c9c.tar.gz erlang.mk-fd9d9f7589d01c4c1046d7b2a117b76e40bd4c9c.tar.bz2 erlang.mk-fd9d9f7589d01c4c1046d7b2a117b76e40bd4c9c.zip |
Handle rebar3-style deps
-rw-r--r-- | core/deps.mk | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/core/deps.mk b/core/deps.mk index 64fa9e6..d032fbb 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -190,16 +190,22 @@ define dep_autopatch_rebar.erl File = case lists:keyfind(deps, 1, Conf) of false -> []; {_, Deps} -> - [begin - Name = element(1, Dep), - {Method, Repo, Commit} = case element(3, Dep) of - {git, R} -> {git, R, master}; - {M, R, {branch, C}} -> {M, R, C}; - {M, R, {tag, C}} -> {M, R, C}; - {M, R, C} -> {M, R, C} - end, - Write(io_lib:format("DEPS += ~s\ndep_~s = ~s ~s ~s~n", [Name, Name, Method, Repo, Commit])) - end || Dep <- Deps, tuple_size(Dep) > 2] + [begin case case Dep of + {N, S} when is_tuple(S) -> {N, S}; + {N, _, S} -> {N, S}; + {N, _, S, _} -> {N, S}; + _ -> false + end of + false -> ok; + {Name, Source} -> + {Method, Repo, Commit} = case Source of + {git, R} -> {git, R, master}; + {M, R, {branch, C}} -> {M, R, C}; + {M, R, {tag, C}} -> {M, R, C}; + {M, R, C} -> {M, R, C} + end, + Write(io_lib:format("DEPS += ~s\ndep_~s = ~s ~s ~s~n", [Name, Name, Method, Repo, Commit])) + end end || Dep <- Deps] end end(), fun() -> |