Skip to content

Commit c8d8d08

Browse files
committed
Raise early if mix xref is used at the umbrella root
None of the commands worked as desired and the only support for umbrellas is in the now removed compiler callback. Closes #12629.
1 parent 6531fc2 commit c8d8d08

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/mix/lib/mix/tasks/xref.ex

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ defmodule Mix.Tasks.Xref do
55
only: [read_manifest: 1, source: 0, source: 1, source: 2, module: 1]
66

77
@shortdoc "Prints cross reference information"
8-
@recursive true
98
@manifest "compile.elixir"
109

1110
@moduledoc """
@@ -256,7 +255,8 @@ defmodule Mix.Tasks.Xref do
256255
257256
* `--include-siblings` - includes dependencies that have `:in_umbrella` set
258257
to true in the current project in the reports. This can be used to find
259-
callers or to analyze graphs between projects
258+
callers or to analyze graphs between projects (it applies only to `trace`
259+
subcommand)
260260
261261
* `--no-compile` - does not compile even if files require compilation
262262
@@ -289,6 +289,12 @@ defmodule Mix.Tasks.Xref do
289289

290290
@impl true
291291
def run(args) do
292+
if Mix.Project.umbrella?() do
293+
Mix.raise(
294+
"mix xref is not supported in the umbrella root. Please run it inside the umbrella applications instead"
295+
)
296+
end
297+
292298
Mix.Task.run("compile", args)
293299
Mix.Task.reenable("xref")
294300

0 commit comments

Comments
 (0)