Package org.gradle.api.artifacts

Examples of org.gradle.api.artifacts.ModuleVersionSelector


    }

    private void resolve(DependencyResolveDetails resolveDetails) {
      ManagedDependencies dependencies = this.versionManagedDependencies
          .getManagedDependencies();
      ModuleVersionSelector target = resolveDetails.getTarget();
      if (SPRING_BOOT_GROUP.equals(target.getGroup())) {
        resolveDetails.useVersion(dependencies.getSpringBootVersion());
        return;
      }
      Dependency dependency = dependencies
          .find(target.getGroup(), target.getName());
      if (dependency != null) {
        resolveDetails.useVersion(dependency.getVersion());
      }
    }
View Full Code Here


        this.metaDataResolver = metaDataResolver;
        this.versionSelectorScheme = versionSelectorScheme;
    }

    public void resolve(DependencyMetaData dependency, BuildableComponentIdResolveResult result) {
        ModuleVersionSelector requested = dependency.getRequested();
        if (versionSelectorScheme.parseSelector(requested.getVersion()).isDynamic()) {
            dynamicRevisionResolver.resolve(dependency, result);
        } else {
            DefaultModuleComponentIdentifier id = new DefaultModuleComponentIdentifier(requested.getGroup(), requested.getName(), requested.getVersion());
            DefaultModuleVersionIdentifier mvId = new DefaultModuleVersionIdentifier(requested.getGroup(), requested.getName(), requested.getVersion());
            result.resolved(id, mvId);
        }
    }
View Full Code Here

            listModuleVersionsFromCache(dependency, result);
        }

        private void listModuleVersionsFromCache(DependencyMetaData dependency, BuildableModuleComponentVersionSelectionResolveResult result) {
            ModuleVersionSelector requested = dependency.getRequested();
            final ModuleIdentifier moduleId = getCacheKey(requested);
            ModuleVersionsCache.CachedModuleVersionList cachedModuleVersionList = moduleVersionsCache.getCachedModuleResolution(delegate, moduleId);
            if (cachedModuleVersionList != null) {
                ModuleVersionListing versionList = cachedModuleVersionList.getModuleVersions();
                Set<ModuleVersionIdentifier> versions = CollectionUtils.collect(versionList.getVersions(), new Transformer<ModuleVersionIdentifier, Versioned>() {
View Full Code Here

        repositories.add(repository);
        repositoryNames.add(repository.getName());
    }

    public void resolve(DependencyMetaData dependency, BuildableComponentResolveResult result) {
        ModuleVersionSelector requested = dependency.getRequested();
        LOGGER.debug("Attempting to resolve {} using repositories {}", requested, repositoryNames);
        ModuleComponentIdentifier moduleComponentIdentifier = new DefaultModuleComponentIdentifier(requested.getGroup(), requested.getName(), requested.getVersion());
        ModuleVersionIdentifier moduleVersionIdentifier = new DefaultModuleVersionIdentifier(requested.getGroup(), requested.getName(), requested.getVersion());

        List<Throwable> errors = new ArrayList<Throwable>();

        List<ComponentMetaDataResolveState> resolveStates = new ArrayList<ComponentMetaDataResolveState>();
        for (ModuleComponentRepository repository : repositories) {
View Full Code Here

    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;
View Full Code Here

        repositories.add(repository);
        repositoryNames.add(repository.getName());
    }

    public void resolve(DependencyMetaData dependency, BuildableComponentIdResolveResult result) {
        ModuleVersionSelector requested = dependency.getRequested();
        LOGGER.debug("Attempting to resolve {} using repositories {}", requested, repositoryNames);
        List<Throwable> errors = new ArrayList<Throwable>();

        List<RepositoryResolveState> resolveStates = new ArrayList<RepositoryResolveState>();
        for (ModuleComponentRepository repository : repositories) {
View Full Code Here

    public ModuleVersionResolveException getFailure() {
        return failure;
    }

    public ModuleComponentSelector getAttempted() {
        ModuleVersionSelector moduleVersionSelector = failure.getSelector();
        return DefaultModuleComponentSelector.newSelector(moduleVersionSelector.getGroup(), moduleVersionSelector.getName(), moduleVersionSelector.getVersion());
    }
View Full Code Here

        this.resolver = resolver;
        this.rule = rule;
    }

    public void resolve(DependencyMetaData dependency, BuildableComponentIdResolveResult result) {
        ModuleVersionSelector module = dependency.getRequested();
        DefaultDependencyResolveDetails details = new DefaultDependencyResolveDetails(module);
        try {
            rule.execute(details);
        } catch (Throwable e) {
            result.failed(new ModuleVersionResolveException(module, e));
View Full Code Here

TOP

Related Classes of org.gradle.api.artifacts.ModuleVersionSelector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.