Interface ResolvedComponentResult
- All Superinterfaces:
ComponentResult
- Since:
- 1.10
-
Method Summary
Modifier and TypeMethodDescriptionSet<? extends DependencyResult> Returns the dependencies of this component.Returns the dependencies of a specific variant.Set<? extends ResolvedDependencyResult> Returns the incoming dependencies of this component.@Nullable ModuleVersionIdentifierReturns the module coordinates of this component, if any.Returns the reason why this particular component was selected in the result.Returns the variants that were selected for this component.Methods inherited from interface ComponentResult
getId
-
Method Details
-
getDependencies
Set<? extends DependencyResult> getDependencies()Returns the dependencies of this component. Includes resolved and unresolved dependencies (if any).
The elements of the returned collection are declared as
DependencyResult, however the dependency instances will also implement one of the following interfaces:ResolvedDependencyResultfor dependencies which were successfully resolved.UnresolvedDependencyResultfor dependencies which could not be resolved for some reason.
- Returns:
- the dependencies of this component
- Since:
- 1.10
-
getDependents
Set<? extends ResolvedDependencyResult> getDependents()Returns the incoming dependencies of this component.- Returns:
- the dependents of this component
- Since:
- 1.10
-
getSelectionReason
ComponentSelectionReason getSelectionReason()Returns the reason why this particular component was selected in the result. Useful if multiple candidate components were found during dependency resolution.- Returns:
- the reason for selecting the component
- Since:
- 1.10
-
getModuleVersion
@Nullable ModuleVersionIdentifier getModuleVersion()Returns the module coordinates of this component, if any.For components identified by a
ProjectComponentIdentifier, this value will be present and specified by the target project'sProject.getGroup(),Project.getName()andProject.getVersion().For components identified by a
ModuleComponentIdentifier, this value will be present and specified by the target component'sModuleComponentIdentifier.getGroup(),ModuleComponentIdentifier.getModule()andModuleComponentIdentifier.getVersion(). In this case, prefer the methods onModuleComponentIdentifier.For components identified by any other identifier, this value may be absent and must not be assumed to be present.
- Returns:
- the module version of the component, or
nullif this component has no associated module version. - Since:
- 1.10
-
getVariants
List<ResolvedVariantResult> getVariants()Returns the variants that were selected for this component. When Gradle metadata is not used, this usually only refers to the target "configuration" (for an Ivy dependency) or "scope" (for a Maven dependency).- Returns:
- the resolved variants for this component
- Since:
- 5.2
-
getDependenciesForVariant
Returns the dependencies of a specific variant. It is possible for a component to be selected multiple times with different variants (for example, the main component and its test fixtures). The dependencies of each variant are different, but themethoddoesn't give access to each variant individual dependencies.The variant must be a selected variant of this component.
- Parameters:
variant- the variant to find the dependencies for- Throws:
IllegalStateException- if the variant is not a selected variant of this component- Since:
- 5.6
-