Skip to content

Commit c345e51

Browse files
author
José Valim
committed
Ensure rebar dependencies are stored in the proper directory
1 parent 75e2270 commit c345e51

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

lib/mix/lib/mix/deps.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ defmodule Mix.Deps do
176176
changing the current working directory and loading the given
177177
project onto the project stack.
178178
179-
This function only works for mix dependencies.
180179
It is expected a loaded dependency as argument.
181180
"""
182181
def in_dependency(dep, post_config // [], fun)

lib/mix/lib/mix/deps/retriever.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ defmodule Mix.Deps.Retriever do
156156
end)
157157
end
158158

159-
defp rebar_dep(Mix.Dep[opts: opts] = dep, _config) do
160-
File.cd!(opts[:dest], fn ->
161-
config = Mix.Rebar.load_config(".")
162-
extra = Dict.take(config, [:sub_dirs])
163-
{ dep.manager(:rebar).extra(extra), rebar_children(config) }
159+
defp rebar_dep(Mix.Dep[] = dep, config) do
160+
Mix.Deps.in_dependency(dep, config, fn _ ->
161+
rebar = Mix.Rebar.load_config(".")
162+
extra = Dict.take(rebar, [:sub_dirs])
163+
{ dep.manager(:rebar).extra(extra), rebar_children(rebar) }
164164
end)
165165
end
166166

lib/mix/lib/mix/tasks/clean.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ defmodule Mix.Tasks.Clean do
1313
1414
"""
1515

16-
# TODO: Needs to take build_path into account
1716
def run(args) do
1817
{ opts, _, _ } = OptionParser.parse(args)
1918

lib/mix/lib/mix/tasks/deps.clean.ex

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ defmodule Mix.Tasks.Deps.Clean do
99
Since this is a destructive action, cleaning of all dependencies
1010
can only happen by passing the `--all` command line option.
1111
12-
Clean does not unlock the repositories, unless `--unlock` is given.
12+
Clean does not unlock the dependencies, unless `--unlock` is given.
1313
"""
14-
1514
import Mix.Deps, only: [loaded: 0, loaded_by_name: 1, format_dep: 1]
1615

17-
# TODO: Needs to take build_path into account
1816
def run(args) do
1917
Mix.Project.get! # Require the project to be available
2018
{ opts, args, _ } = OptionParser.parse(args, switches: [unlock: :boolean, all: :boolean])

0 commit comments

Comments
 (0)