api / org.gradle.api.artifacts.result / ResolutionResult

ResolutionResult

@Incubating interface ResolutionResult

Contains the information about the result of dependency resolution. You can use this type to determine all the component instances that are included in the resolved dependency graph, and the dependencies between them.

Functions

allComponents

abstract fun allComponents(action: Action<in ResolvedComponentResult>): Unit

Applies given action for each component. An instance of ResolvedComponentResult is passed as parameter to the action.

abstract fun allComponents(closure: Closure<Any>): Unit

Applies given closure for each component. An instance of ResolvedComponentResult is passed as parameter to the closure.

allDependencies

abstract fun allDependencies(action: Action<in DependencyResult>): Unit

Applies given action for each dependency. An instance of DependencyResult is passed as parameter to the action.

abstract fun allDependencies(closure: Closure<Any>): Unit

Applies given closure for each dependency. An instance of DependencyResult is passed as parameter to the closure.

getAllComponents

abstract fun getAllComponents(): MutableSet<ResolvedComponentResult>

Retrieves all instances of ResolvedComponentResult from the graph, e.g. all nodes of the dependency graph.

getAllDependencies

abstract fun getAllDependencies(): MutableSet<out DependencyResult>

Retrieves all dependencies, including unresolved dependencies. Resolved dependencies are represented by instances of ResolvedDependencyResult, unresolved dependencies by UnresolvedDependencyResult. In dependency graph terminology, this method returns the edges of the graph.

getRoot

abstract fun getRoot(): ResolvedComponentResult

Gives access to the root of resolved dependency graph. You can walk the graph recursively from the root to obtain information about resolved dependencies. For example, Gradle's built-in 'dependencies' task uses this to render the dependency tree.