Builds a module dependency graph using OTP's :xref tool.
The graph is a map of %{caller_module => [callee_module]} derived from
BEAM files. Results are cached in :persistent_term for the duration of
the test run.
No external dependencies are required — :xref and :beam_lib are
standard OTP applications.
Summary
Functions
Returns all modules known in the graph.
Returns the dependency graph for the given OTP application (or all loaded
modules if app is :all).
Builds a dependency graph from a specific BEAM directory path.
Returns all dependency cycles found in the given modules.
Returns the direct dependencies of module (modules it calls).
Returns all modules that directly depend on module (callers of it).
Computes transitive dependencies of module up to max_depth hops
(default: unlimited).
Types
Functions
Returns all modules known in the graph.
Returns the dependency graph for the given OTP application (or all loaded
modules if app is :all).
The graph is cached in :persistent_term after the first call.
Pass force: true to bypass the cache and rebuild.
Options
:app— OTP app atom or:all(default:all):force— boolean, bypass cache (defaultfalse)
Builds a dependency graph from a specific BEAM directory path.
Useful for testing against a pre-compiled application without registering it as an OTP application.
Options
:force— boolean, bypass cache (defaultfalse)
Example
ebin = "test/support/fixture_app/_build/dev/lib/fixture_app/ebin"
graph = ArchTest.Collector.build_graph_from_path(ebin)
Returns all dependency cycles found in the given modules.
Each cycle is a list of modules forming a circular dependency chain.
Returns the direct dependencies of module (modules it calls).
Returns all modules that directly depend on module (callers of it).
@spec transitive_dependencies_of(graph(), module(), pos_integer() | :infinity) :: [ module() ]
Computes transitive dependencies of module up to max_depth hops
(default: unlimited).