Skip to content

Commit

Permalink
Do not load mix.exs file for rebar deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmj committed Jun 21, 2016
1 parent d18bc9b commit 50b9b45
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
30 changes: 15 additions & 15 deletions lib/mix/lib/mix/dep/loader.ex
Original file line number Diff line number Diff line change
Expand Up @@ -266,22 +266,22 @@ defmodule Mix.Dep.Loader do
{dep, deps}
end

defp rebar_dep(%Mix.Dep{app: app} = dep, children, manager) do
Mix.Dep.in_dependency(dep, fn _ ->
config = Mix.Rebar.load_config(".")
extra = Mix.Rebar.merge_config(dep.extra, config)
deps =
if children do
from = Path.absname("rebar.config")
# Pass the manager because deps of a Rebar project need
# to default to Rebar if we cannot chose a manager from
# files in the dependency
Enum.map(children, &to_dep(&1, from, manager))
else
rebar_children(app, config, extra, manager)
end
{%{dep | extra: extra}, deps}
defp rebar_dep(%Mix.Dep{app: app, opts: opts} = dep, children, manager) do
config = File.cd!(opts[:dest], fn ->
Mix.Rebar.load_config(".")
end)
extra = Mix.Rebar.merge_config(dep.extra, config)
deps =
if children do
from = Path.absname("rebar.config")
# Pass the manager because deps of a Rebar project need
# to default to Rebar if we cannot chose a manager from
# files in the dependency
Enum.map(children, &to_dep(&1, from, manager))
else
rebar_children(app, config, extra, manager)
end
{%{dep | extra: extra}, deps}
end

defp make_dep(dep) do
Expand Down
6 changes: 3 additions & 3 deletions lib/mix/lib/mix/tasks/deps.compile.ex
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,15 @@ defmodule Mix.Tasks.Deps.Compile do
end
end

defp do_command(%Mix.Dep{app: app} = dep, config, command, print_app?, env \\ []) do
Mix.Dep.in_dependency dep, fn _ ->
defp do_command(%Mix.Dep{app: app, opts: opts}, config, command, print_app?, env \\ []) do
File.cd!(opts[:dest], fn ->
env = [{"ERL_LIBS", Path.join(config[:env_path], "lib")}] ++ env
if Mix.shell.cmd(command, print_app: print_app?, env: env) != 0 do
Mix.raise "Could not compile dependency #{inspect app}, \"#{command}\" command failed. " <>
"You can recompile this dependency with \"mix deps.compile #{app}\", update it " <>
"with \"mix deps.update #{app}\" or clean it with \"mix deps.clean #{app}\""
end
end
end)
true
end

Expand Down

0 comments on commit 50b9b45

Please sign in to comment.