@@ -9,10 +9,15 @@ defmodule Mix.Tasks.Compile.Xref do
99 @ moduledoc """
1010 Performs remote dispatch checking.
1111
12- When this task runs, it will check the modification time of the `:elixir`
13- compiler manifest. If it has changed, `mix xref` will be run to check remote
14- dispatches. You can force checking regardless of modification time by passing
15- the `--force` option.
12+ It uses `mix xref` to check if any remote call does not exist or is
13+ deprecated, and emits a warnings in such cases. This tasks does not show
14+ deprecated local calls (a call to a deprecated function or macro in the
15+ same module) nor calls to deprecated functionality in Elixir itself.
16+
17+ When this task runs, it will check if the source code has been modified.
18+ If it has changed, `mix xref` will be run to check remote dispatches. You
19+ can force checking regardless of modification time by passing the `--force`
20+ option.
1621
1722 ## Command line options
1823
@@ -28,6 +33,8 @@ defmodule Mix.Tasks.Compile.Xref do
2833 { opts , _ , _ } =
2934 OptionParser . parse ( args , switches: [ force: :boolean , warnings_as_errors: :boolean ] )
3035
36+ Mix.Task . run ( "compile" )
37+
3138 warnings =
3239 if needs_xref? ( opts ) do
3340 run_xref ( )
@@ -48,15 +55,9 @@ defmodule Mix.Tasks.Compile.Xref do
4855
4956 defp run_xref do
5057 timestamp = :calendar . universal_time ( )
51-
52- case Mix.Task . run ( "xref" , [ "warnings" ] ) do
53- :noop ->
54- [ ]
55-
56- { :ok , warnings } ->
57- write_manifest ( warnings , timestamp )
58- warnings
59- end
58+ warnings = Mix.Tasks.Xref . warnings ( [ ] )
59+ write_manifest ( warnings , timestamp )
60+ warnings
6061 end
6162
6263 defp warnings_as_errors ( opts ) do
0 commit comments