Skip to content

Commit 494bded

Browse files
author
José Valim
committed
deps.check -> deps.loadpaths
deps.loadpaths was public API that Nerves, in particular, depended on. This commit brings back the deps.loadpaths task, replacing the incorrect deps.check that should not be required by Nerves.
1 parent 2b0fc52 commit 494bded

File tree

12 files changed

+35
-33
lines changed

12 files changed

+35
-33
lines changed

lib/mix/lib/mix/dep.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ defmodule Mix.Dep do
6464
@doc """
6565
Returns loaded dependencies from the cache for the current environment.
6666
67-
Because the dependencies are cached during deps.check, their
67+
Because the dependencies are cached during deps.loadpaths, their
6868
status may be outdated (for example, `:compile` did not
6969
yet become `:ok`). Therefore it is recommended to not rely
7070
on their status, also given they haven't been checked

lib/mix/lib/mix/dep/converger.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ defmodule Mix.Dep.Converger do
8484
if not diverged? && remote do
8585
# If there is a lock, it means we are doing a get/update
8686
# and we need to hit the remote converger which do external
87-
# requests and what not. In case of deps.check, deps and so
87+
# requests and what not. In case of deps.loadpaths, deps and so
8888
# on, there is no lock, so we won't hit this branch.
8989
lock = if lock_given?, do: remote.converge(deps, lock), else: lock
9090

lib/mix/lib/mix/task.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ defmodule Mix.Task do
275275
# 2. Otherwise we look for it in dependencies.
276276
# 3. Finally, we compile the current project in hope it is available.
277277
module =
278-
get_task_or_run(proj, task, fn -> Mix.Task.run("deps.check") end) ||
278+
get_task_or_run(proj, task, fn -> Mix.Task.run("deps.loadpaths") end) ||
279279
get_task_or_run(proj, task, fn -> Mix.Project.compile([]) end) ||
280280
get!(task)
281281

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ defmodule Mix.Tasks.Clean do
4949
defp loadpaths! do
5050
Mix.Task.run "loadpaths", ["--no-elixir-version-check", "--no-deps-check", "--no-archives-check"]
5151
Mix.Task.reenable "loadpaths"
52-
Mix.Task.reenable "deps.check"
52+
Mix.Task.reenable "deps.loadpaths"
5353
end
5454
end

lib/mix/lib/mix/tasks/compile.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ defmodule Mix.Tasks.Compile do
9595
defp loadpaths! do
9696
Mix.Task.run "loadpaths", ["--no-elixir-version-check", "--no-deps-check", "--no-archives-check"]
9797
Mix.Task.reenable "loadpaths"
98-
Mix.Task.reenable "deps.check"
98+
Mix.Task.reenable "deps.loadpaths"
9999
end
100100

101101
defp consolidate_protocols? do

lib/mix/lib/mix/tasks/deps.check.ex renamed to lib/mix/lib/mix/tasks/deps.loadpaths.ex

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
defmodule Mix.Tasks.Deps.Check do
1+
defmodule Mix.Tasks.Deps.Loadpaths do
22
use Mix.Task
33

44
import Mix.Dep, only: [loaded_by_name: 2, format_dep: 1, ok?: 1,
55
format_status: 1, check_lock: 1]
66

77
@moduledoc """
8-
Checks if all dependencies are valid,
9-
loading them along the way.
8+
Checks and loads all dependencies along the way.
109
1110
If there is an invalid dependency, its status is printed
1211
before aborting.
1312
13+
Although this task does not show up in `mix help`, it is
14+
part of Mix public API and can be depended on.
15+
1416
## Command line options
1517
1618
* `--no-deps-check` - do not check or compile deps, only load available ones

lib/mix/lib/mix/tasks/help.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ defmodule Mix.Tasks.Help do
107107
defp loadpaths! do
108108
Mix.Task.run "loadpaths", ["--no-elixir-version-check", "--no-deps-check", "--no-archives-check"]
109109
Mix.Task.reenable "loadpaths"
110-
Mix.Task.reenable "deps.check"
110+
Mix.Task.reenable "deps.loadpaths"
111111
end
112112

113113
defp load_tasks() do

lib/mix/lib/mix/tasks/loadpaths.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ defmodule Mix.Tasks.Loadpaths do
3333
# --no-deps is used only internally. It has no purpose
3434
# from Mix.CLI because the CLI itself already loads deps.
3535
unless "--no-deps" in args do
36-
Mix.Task.run "deps.check", args
36+
Mix.Task.run "deps.loadpaths", args
3737
end
3838

3939
if config[:app] do

lib/mix/test/mix/dep_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,12 @@ defmodule Mix.DepTest do
346346
refute_received {:mix_shell, :info, ["* Getting" <> _]}
347347

348348
assert_raise Mix.Error, "Can't continue due to errors on dependencies", fn ->
349-
Mix.Tasks.Deps.Check.run([])
349+
Mix.Tasks.Deps.Loadpaths.run([])
350350
end
351351

352352
Mix.ProjectStack.clear_cache()
353353
Mix.env(:prod)
354-
Mix.Tasks.Deps.Check.run([])
354+
Mix.Tasks.Deps.Loadpaths.run([])
355355
end
356356
end
357357
end

lib/mix/test/mix/tasks/deps.git_test.exs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ defmodule Mix.Tasks.DepsGitTest do
9090
File.rm_rf!("deps/git_repo/.git")
9191

9292
assert_raise Mix.Error, "Can't continue due to errors on dependencies", fn ->
93-
Mix.Tasks.Deps.Check.run ["git_repo"]
93+
Mix.Tasks.Deps.Loadpaths.run ["git_repo"]
9494
end
9595
end
9696
end
@@ -126,7 +126,7 @@ defmodule Mix.Tasks.DepsGitTest do
126126
Code.delete_path("_build/dev/lib/git_repo/ebin")
127127

128128
# Deps on Git repo loads it automatically on compile
129-
Mix.Task.reenable "deps.check"
129+
Mix.Task.reenable "deps.loadpaths"
130130
Mix.Tasks.Deps.Compile.run ["deps_on_git_repo"]
131131
assert File.exists?("_build/dev/lib/deps_on_git_repo/ebin")
132132
end
@@ -243,7 +243,7 @@ defmodule Mix.Tasks.DepsGitTest do
243243
# Update the lock and now we should get an error
244244
Mix.Dep.Lock.write %{git_repo: {:git, fixture_path("git_repo"), last, []}}
245245
assert_raise Mix.Error, fn ->
246-
Mix.Tasks.Deps.Check.run []
246+
Mix.Tasks.Deps.Loadpaths.run []
247247
end
248248

249249
# Flush the errors we got, move to a clean slate

0 commit comments

Comments
 (0)