use of org.gradle.api.artifacts.component.ModuleComponentSelector in project gradle by gradle.
the class CompositeBuildDependencySubstitutions method execute.
@Override
public void execute(DependencySubstitution sub) {
DependencySubstitutionInternal dependencySubstitution = (DependencySubstitutionInternal) sub;
// Use the result of previous rules as the input for dependency substitution
ComponentSelector requested = dependencySubstitution.getTarget();
if (requested instanceof ModuleComponentSelector) {
ModuleComponentSelector selector = (ModuleComponentSelector) requested;
ProjectComponentIdentifier replacement = getReplacementFor(selector);
if (replacement != null) {
ProjectComponentSelector targetProject = DefaultProjectComponentSelector.newSelector(replacement, ((AttributeContainerInternal) requested.getAttributes()).asImmutable(), requested.getRequestedCapabilities());
dependencySubstitution.useTarget(targetProject, ComponentSelectionReasons.COMPOSITE_BUILD);
}
}
}
Aggregations