use of org.gradle.api.internal.artifacts.ivyservice.dependencysubstitution.ArtifactSelectionDetailsInternal in project gradle by gradle.
the class NodeState method maybeSubstitute.
/**
* Execute any dependency substitution rules that apply to this dependency.
*
* This may be better done as a decorator on ConfigurationMetadata.getDependencies()
*/
static DependencyState maybeSubstitute(DependencyState dependencyState, DependencySubstitutionApplicator dependencySubstitutionApplicator) {
DependencySubstitutionApplicator.SubstitutionResult substitutionResult = dependencySubstitutionApplicator.apply(dependencyState.getDependency());
if (substitutionResult.hasFailure()) {
dependencyState.failure = new ModuleVersionResolveException(dependencyState.getRequested(), substitutionResult.getFailure());
return dependencyState;
}
DependencySubstitutionInternal details = substitutionResult.getResult();
if (details != null && details.isUpdated()) {
ArtifactSelectionDetailsInternal artifactSelectionDetails = details.getArtifactSelectionDetails();
if (artifactSelectionDetails.isUpdated()) {
return dependencyState.withTargetAndArtifacts(details.getTarget(), artifactSelectionDetails.getTargetSelectors(), details.getRuleDescriptors());
}
return dependencyState.withTarget(details.getTarget(), details.getRuleDescriptors());
}
return dependencyState;
}
Aggregations