Package org.gradle.api.artifacts.result
Interface ResolutionResult
-
public interface ResolutionResultContains 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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidallComponents(Closure closure)Applies given closure for each component.voidallComponents(Action<? super ResolvedComponentResult> action)Applies given action for each component.voidallDependencies(Closure closure)Applies given closure for each dependency.voidallDependencies(Action<? super DependencyResult> action)Applies given action for each dependency.java.util.Set<ResolvedComponentResult>getAllComponents()Retrieves all instances ofResolvedComponentResultfrom the graph, e.g.java.util.Set<? extends DependencyResult>getAllDependencies()Retrieves all dependencies, including unresolved dependencies.AttributeContainergetRequestedAttributes()The attributes that were requested.ResolvedComponentResultgetRoot()Gives access to the root of resolved dependency graph.Provider<ResolvedComponentResult>getRootComponent()Returns the root of resolved dependency graph as aProviderofResolvedComponentResult.
-
-
-
Method Detail
-
getRoot
ResolvedComponentResult getRoot()
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.- Returns:
- the root node of the resolved dependency graph
-
getRootComponent
Provider<ResolvedComponentResult> getRootComponent()
Returns the root of resolved dependency graph as aProviderofResolvedComponentResult. The returnedProvideris live, and tracks the producer tasks of this resolution result. The provider will resolve the component metadata as required. 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.- Returns:
- a provider for the root node of the resolved dependency graph
- Since:
- 7.4
-
getAllDependencies
java.util.Set<? extends DependencyResult> getAllDependencies()
Retrieves all dependencies, including unresolved dependencies. Resolved dependencies are represented by instances ofResolvedDependencyResult, unresolved dependencies byUnresolvedDependencyResult. In dependency graph terminology, this method returns the edges of the graph.- Returns:
- all dependencies, including unresolved dependencies.
-
allDependencies
void allDependencies(Action<? super DependencyResult> action)
Applies given action for each dependency. An instance ofDependencyResultis passed as parameter to the action.- Parameters:
action- - action that is applied for each dependency
-
allDependencies
void allDependencies(@DelegatesTo(DependencyResult.class) Closure closure)
Applies given closure for each dependency. An instance ofDependencyResultis passed as parameter to the closure.- Parameters:
closure- - closure that is applied for each dependency
-
getAllComponents
java.util.Set<ResolvedComponentResult> getAllComponents()
Retrieves all instances ofResolvedComponentResultfrom the graph, e.g. all nodes of the dependency graph.- Returns:
- all nodes of the dependency graph.
-
allComponents
void allComponents(Action<? super ResolvedComponentResult> action)
Applies given action for each component. An instance ofResolvedComponentResultis passed as parameter to the action.- Parameters:
action- - action that is applied for each component
-
allComponents
void allComponents(@DelegatesTo(ResolvedComponentResult.class) Closure closure)
Applies given closure for each component. An instance ofResolvedComponentResultis passed as parameter to the closure.- Parameters:
closure- - closure that is applied for each component
-
getRequestedAttributes
AttributeContainer getRequestedAttributes()
The attributes that were requested. Those are the attributes which are used during variant aware resolution, to select the variants. Attributes returned by this method are desugared, meaning that they have lost their rich types and can only be of type Boolean or String.- Since:
- 5.6
-
-