Skip to content

Commit 90543e8

Browse files
author
José Valim
committed
deps.check -> deps.loadpaths
1 parent 50c5729 commit 90543e8

File tree

12 files changed

+42
-43
lines changed

12 files changed

+42
-43
lines changed

lib/mix/lib/mix/dep.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ 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
68-
status may be outdated (for example, `:compile` did not
67+
Because the dependencies are cached during deps.loadpaths,
68+
their 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
7171
against the lock.

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.loadpths, 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: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
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 (including archives) 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
17-
* `--no-deps-loading` - do not load dependencies
1819
* `--no-compile` - do not compile dependencies
1920
2021
"""
@@ -26,15 +27,13 @@ defmodule Mix.Tasks.Deps.Check do
2627
deps_check(all, "--no-compile" in args)
2728
end
2829

29-
unless "--no-deps-loading" in args do
30-
load_paths =
31-
for dep <- all, path <- Mix.Dep.load_paths(dep) do
32-
_ = Code.prepend_path(path)
33-
path
34-
end
30+
load_paths =
31+
for dep <- all, path <- Mix.Dep.load_paths(dep) do
32+
_ = Code.prepend_path(path)
33+
path
34+
end
3535

36-
prune_deps(load_paths, "--no-deps-check" in args)
37-
end
36+
prune_deps(load_paths, "--no-deps-check" in args)
3837
end
3938

4039
# If the build is per environment, we should be able to look

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

lib/mix/test/mix/tasks/deps_test.exs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ defmodule Mix.Tasks.DepsTest do
133133
end
134134
end
135135

136-
## deps.check
136+
## deps.loadpaths
137137

138138
test "checks list of dependencies and their status with success" do
139139
Mix.Project.push SuccessfulDepsApp
140140

141141
in_fixture "deps_status", fn ->
142-
Mix.Tasks.Deps.Check.run []
142+
Mix.Tasks.Deps.Loadpaths.run []
143143
end
144144
end
145145

@@ -148,7 +148,7 @@ defmodule Mix.Tasks.DepsTest do
148148

149149
in_fixture "deps_status", fn ->
150150
assert_raise Mix.Error, fn ->
151-
Mix.Tasks.Deps.Check.run []
151+
Mix.Tasks.Deps.Loadpaths.run []
152152
end
153153

154154
assert_received {:mix_shell, :error, ["* ok (https://github.com/elixir-lang/ok.git)"]}
@@ -172,7 +172,7 @@ defmodule Mix.Tasks.DepsTest do
172172
File.rm_rf("_build")
173173

174174
Mix.Tasks.Deps.Compile.run []
175-
Mix.Tasks.Deps.Check.run []
175+
Mix.Tasks.Deps.Loadpaths.run []
176176
assert File.exists?("_build/dev/lib/ok/ebin/ok.app")
177177
assert File.exists?("_build/dev/lib/ok/priv/sample")
178178

@@ -186,7 +186,7 @@ defmodule Mix.Tasks.DepsTest do
186186
Mix.Project.pop
187187
Mix.Project.push SuccessfulDepsApp
188188

189-
Mix.Tasks.Deps.Check.run []
189+
Mix.Tasks.Deps.Loadpaths.run []
190190
refute to_charlist(Path.expand("_build/dev/lib/ok/ebin/")) in :code.get_path
191191
assert File.exists?("_build/dev/lib/ok/ebin/ok.app")
192192
assert File.exists?("_build/dev/lib/sample/ebin/sample.app")
@@ -197,7 +197,7 @@ defmodule Mix.Tasks.DepsTest do
197197
Mix.Project.pop
198198
Mix.Project.push SuccessfulDepsApp
199199

200-
Mix.Tasks.Deps.Check.run []
200+
Mix.Tasks.Deps.Loadpaths.run []
201201
refute File.exists?("_build/dev/lib/ok/ebin/ok.app")
202202
assert File.exists?("_build/dev/lib/sample/ebin/sample.app")
203203
end
@@ -362,7 +362,7 @@ defmodule Mix.Tasks.DepsTest do
362362

363363
in_fixture "deps_status", fn ->
364364
assert_raise Mix.Error, fn ->
365-
Mix.Tasks.Deps.Check.run []
365+
Mix.Tasks.Deps.Loadpaths.run []
366366
end
367367
assert_received {:mix_shell, :error, [" the dependency git_repo in mix.exs is overriding a child dependency" <> _]}
368368

@@ -383,7 +383,7 @@ defmodule Mix.Tasks.DepsTest do
383383

384384
in_fixture "deps_status", fn ->
385385
assert_raise Mix.Error, fn ->
386-
Mix.Tasks.Deps.Check.run []
386+
Mix.Tasks.Deps.Loadpaths.run []
387387
end
388388

389389
assert_received {:mix_shell, :error, [" different specs were given for the git_repo app:" <> _ = msg]}
@@ -414,7 +414,7 @@ defmodule Mix.Tasks.DepsTest do
414414

415415
assert_raise Mix.Error, fn ->
416416
Mix.Tasks.Deps.Get.run []
417-
Mix.Tasks.Deps.Check.run []
417+
Mix.Tasks.Deps.Loadpaths.run []
418418
end
419419

420420
assert_received {:mix_shell, :error, [" the dependency git_repo 0.1.0" <> _ = msg]}
@@ -445,7 +445,7 @@ defmodule Mix.Tasks.DepsTest do
445445

446446
assert_raise Mix.Error, fn ->
447447
Mix.Tasks.Deps.Get.run []
448-
Mix.Tasks.Deps.Check.run []
448+
Mix.Tasks.Deps.Loadpaths.run []
449449
end
450450

451451
assert_received {:mix_shell, :error, [" the dependency git_repo in mix.exs is overriding" <> _]}
@@ -501,7 +501,7 @@ defmodule Mix.Tasks.DepsTest do
501501

502502
in_fixture "deps_status", fn ->
503503
assert_raise Mix.Error, fn ->
504-
Mix.Tasks.Deps.Check.run []
504+
Mix.Tasks.Deps.Loadpaths.run []
505505
end
506506

507507
receive do
@@ -521,7 +521,7 @@ defmodule Mix.Tasks.DepsTest do
521521

522522
in_fixture "deps_status", fn ->
523523
Mix.Tasks.Deps.Compile.run []
524-
Mix.Tasks.Deps.Check.run []
524+
Mix.Tasks.Deps.Loadpaths.run []
525525

526526
File.mkdir_p!("_build/dev/lib/ok/ebin")
527527
manifest_data = :erlang.term_to_binary({:v1, "the_future", :scm})
@@ -533,8 +533,8 @@ defmodule Mix.Tasks.DepsTest do
533533
Mix.Tasks.Deps.run []
534534
assert_received {:mix_shell, :info, [^msg]}
535535

536-
# deps.check will automatically recompile it
537-
Mix.Tasks.Deps.Check.run []
536+
# deps.loadpaths will automatically recompile it
537+
Mix.Tasks.Deps.Loadpaths.run []
538538

539539
Mix.Tasks.Deps.run []
540540
refute_received {:mix_shell, :info, [^msg]}
@@ -546,7 +546,7 @@ defmodule Mix.Tasks.DepsTest do
546546

547547
in_fixture "deps_status", fn ->
548548
Mix.Tasks.Deps.Compile.run []
549-
Mix.Tasks.Deps.Check.run []
549+
Mix.Tasks.Deps.Loadpaths.run []
550550

551551
File.mkdir_p!("_build/dev/lib/ok/ebin")
552552
manifest_data = :erlang.term_to_binary({:v1, System.version, :scm})
@@ -558,8 +558,8 @@ defmodule Mix.Tasks.DepsTest do
558558
Mix.Tasks.Deps.run []
559559
assert_received {:mix_shell, :info, [^msg]}
560560

561-
# deps.check will automatically recompile it
562-
Mix.Tasks.Deps.Check.run []
561+
# deps.loadpaths will automatically recompile it
562+
Mix.Tasks.Deps.Loadpaths.run []
563563

564564
Mix.Tasks.Deps.run []
565565
refute_received {:mix_shell, :info, [^msg]}

lib/mix/test/mix/umbrella_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule Mix.UmbrellaTest do
1414

1515
# Ensure we can compile and run checks
1616
Mix.Task.run "deps.compile"
17-
Mix.Task.run "deps.check"
17+
Mix.Task.run "deps.loadpaths"
1818
Mix.Task.run "compile", ["--verbose"]
1919

2020
assert_received {:mix_shell, :info, ["==> bar"]}

0 commit comments

Comments
 (0)