Skip to content

Commit f1323ad

Browse files
author
José Valim
committed
Accept upcoming hex formats
1 parent 89561c3 commit f1323ad

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/mix/lib/mix/dep/loader.ex

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ defmodule Mix.Dep.Loader do
207207
# now because umbrella projects are not supported.
208208
defp mix_dep(%Mix.Dep{opts: opts} = dep, children) do
209209
from = Path.join(opts[:dest], "mix.exs")
210-
deps = Enum.map(children, &to_dep({&1, []}, from))
210+
deps = Enum.map(children, &to_dep(remote_dep(&1), from))
211211
{%{dep | manager: :mix, extra: [umbrella: false]}, deps}
212212
end
213213

@@ -217,7 +217,7 @@ defmodule Mix.Dep.Loader do
217217
extra = Dict.take(rebar, [:sub_dirs])
218218
deps = if children do
219219
from = Path.absname("rebar.config")
220-
Enum.map(children, &to_dep({&1, []}, from, :rebar))
220+
Enum.map(children, &to_dep(remote_dep(&1), from, :rebar))
221221
else
222222
rebar_children(rebar)
223223
end
@@ -229,6 +229,12 @@ defmodule Mix.Dep.Loader do
229229
{%{dep | manager: :make}, []}
230230
end
231231

232+
# TODO: Deprecated - future Hex releases will return a
233+
# tuple and no longer an atom, so we can remove the atom
234+
# check from here.
235+
defp remote_dep(app) when is_atom(app), do: {app, []}
236+
defp remote_dep(dep) when is_tuple(dep), do: dep
237+
232238
defp mix_children(opts) do
233239
from = Path.absname("mix.exs")
234240
deps = Enum.map(Mix.Project.config[:deps] || [], &to_dep(&1, from))

0 commit comments

Comments
 (0)