use of org.gradle.internal.component.local.model.DefaultProjectDependencyMetadata in project gradle by gradle.
the class DefaultDependencyMetadata method withTarget.
@Override
public DependencyMetadata withTarget(ComponentSelector target) {
if (target instanceof ModuleComponentSelector) {
ModuleComponentSelector moduleTarget = (ModuleComponentSelector) target;
ModuleVersionSelector requestedVersion = DefaultModuleVersionSelector.newSelector(moduleTarget.getGroup(), moduleTarget.getModule(), moduleTarget.getVersion());
if (requestedVersion.equals(requested)) {
return this;
}
return withRequested(requestedVersion);
} else if (target instanceof ProjectComponentSelector) {
ProjectComponentSelector projectTarget = (ProjectComponentSelector) target;
return new DefaultProjectDependencyMetadata(projectTarget, this);
} else {
throw new IllegalArgumentException("Unexpected selector provided: " + target);
}
}
Aggregations