ProjectGraph

data class ProjectGraph(val builds: Map<String, List<Module>>, externalDependenciesLoader: () -> DependencyGraphModel? = { DependencyGraphModel() })

Represents the complete structural graph of the multi-project/composite build. It provides core querying capabilities, circular dependency verification, and access to the parsed class/declaration hierarchy of the entire workspace.

Constructors

Link copied to clipboard
constructor(builds: Map<String, List<Module>>, externalDependenciesLoader: () -> DependencyGraphModel? = { DependencyGraphModel() })

Types

Link copied to clipboard
object Companion

Factory and state management methods for default ProjectGraph instances.

Properties

Link copied to clipboard

Filter or assertion criteria for builds.

Link copied to clipboard
val externalDependencies: DependencyGraphModel

Filter or assertion criteria for external dependencies.

Functions

Link copied to clipboard
fun assertNoCycles(includeTestConfigurations: Boolean = false)

Detects dependency cycles in the module graph and throws an AssertionError if any cycle is found. The verification is performed using a Depth-First Search (DFS) traversal over module dependency edges. Note: DFS depth corresponds to the maximum module dependency depth in the graph.

Link copied to clipboard
fun findModule(buildId: String, path: String): Module?

Looks up a module within the project graph by its build ID and Gradle project path.

Link copied to clipboard

Returns a flat list of all modules across all builds in this graph.