private boolean isGeneratedModuleDescriptor(ComponentResolveMetaData componentResolveMetaData) {
return componentResolveMetaData.isGenerated();
}
public ModuleComponentIdentifier choose(ModuleVersionListing versions, DependencyMetaData dependency, ModuleComponentRepositoryAccess moduleAccess) {
ModuleVersionSelector requestedModule = dependency.getRequested();
VersionSelector requestedVersion = versionSelectorScheme.parseSelector(requestedModule.getVersion());
Collection<SpecRuleAction<? super ComponentSelection>> rules = componentSelectionRules.getRules();
for (Versioned candidate : sortLatestFirst(versions)) {
ModuleComponentIdentifier candidateIdentifier = DefaultModuleComponentIdentifier.newId(requestedModule.getGroup(), requestedModule.getName(), candidate.getVersion());
MetadataProvider metadataProvider = new MetadataProvider(new MetaDataSupplier(dependency, candidateIdentifier, moduleAccess));
if (versionMatches(requestedVersion, candidateIdentifier, metadataProvider)) {
if (!isRejectedByRules(candidateIdentifier, rules, metadataProvider)) {
return candidateIdentifier;