use of org.gradle.api.internal.artifacts.dependencies.DefaultResolvedVersionConstraint in project gradle by gradle.
the class RepositoryChainDependencyToComponentIdResolver method resolve.
public void resolve(DependencyMetadata dependency, ResolvedVersionConstraint resolvedVersionConstraint, BuildableComponentIdResolveResult result) {
ComponentSelector componentSelector = dependency.getSelector();
if (componentSelector instanceof ModuleComponentSelector) {
ModuleComponentSelector module = (ModuleComponentSelector) componentSelector;
if (resolvedVersionConstraint == null) {
// TODO:DAZ This shouldn't be required, but `ExternalResourceResolverDescriptorParseContext` does not provide a resolved constraint
VersionConstraint raw = module.getVersionConstraint();
resolvedVersionConstraint = new DefaultResolvedVersionConstraint(raw, versionSelectorScheme);
}
VersionSelector preferredSelector = resolvedVersionConstraint.getPreferredSelector();
if (preferredSelector.isDynamic()) {
dynamicRevisionResolver.resolve(toModuleDependencyMetadata(dependency), preferredSelector, resolvedVersionConstraint.getRejectedSelector(), result);
} else {
String version = resolvedVersionConstraint.getPreferredVersion();
ModuleComponentIdentifier id = new DefaultModuleComponentIdentifier(module.getGroup(), module.getModule(), version);
ModuleVersionIdentifier mvId = moduleIdentifierFactory.moduleWithVersion(module.getGroup(), module.getModule(), version);
result.resolved(id, mvId);
}
}
}
Aggregations