Package org.gradle.api.artifacts.component

Examples of org.gradle.api.artifacts.component.ComponentIdentifier


                        List<? extends ResolutionAwareRepository> repositories,
                        GlobalDependencyResolutionRules metadataHandler,
                        ResolverResults results) throws ResolveException {
        if (configuration.getAllDependencies().isEmpty()) {
            ModuleVersionIdentifier id = DefaultModuleVersionIdentifier.newId(configuration.getModule());
            ComponentIdentifier componentIdentifier = componentIdentifierFactory.createComponentIdentifier(configuration.getModule());
            ResolutionResult emptyResult = new DefaultResolutionResultBuilder().start(id, componentIdentifier).complete();
            results.resolved(new EmptyResolvedConfiguration(), emptyResult);
        } else {
            dependencyResolver.resolve(configuration, repositories, metadataHandler, results);
        }
View Full Code Here


    public MutableLocalComponentMetaData convert(Set<? extends Configuration> configurations, ModuleInternal module) {
        assert configurations.size() > 0 : "No configurations found for module: " + module.getName() + ". Configure them or apply a plugin that does it.";
        DefaultModuleDescriptor moduleDescriptor = new DefaultModuleDescriptor(IvyUtil.createModuleRevisionId(module), module.getStatus(), null);
        moduleDescriptor.addExtraAttributeNamespace(IVY_MAVEN_NAMESPACE_PREFIX, IVY_MAVEN_NAMESPACE);
        ComponentIdentifier componentIdentifier = componentIdentifierFactory.createComponentIdentifier(module);
        DefaultLocalComponentMetaData metaData = new DefaultLocalComponentMetaData(moduleDescriptor, componentIdentifier);
        configurationsToModuleDescriptorConverter.addConfigurations(metaData, configurations);
        dependenciesToModuleDescriptorConverter.addDependencyDescriptors(metaData, configurations);
        configurationsToArtifactsConverter.addArtifacts(metaData, configurations);
        return metaData;
View Full Code Here

        return false;
    }

    private boolean matchesSelected(ResolvedDependencyResult candidate) {
        ComponentIdentifier selected = candidate.getSelected().getId();

        if (moduleIdentifier != null && selected instanceof ModuleComponentIdentifier) {
            ModuleComponentIdentifier selectedModule = (ModuleComponentIdentifier) selected;
            return selectedModule.getGroup().equals(moduleIdentifier.getGroup())
                    && selectedModule.getModule().equals(moduleIdentifier.getName());
View Full Code Here

        return getActual();
    }

    public String getName() {
        ComponentSelector requested = getRequested();
        ComponentIdentifier selected = getActual();

        if(requested.matchesStrictly(selected)) {
            return getSimpleName();
        }

        if(requested instanceof ModuleComponentSelector && selected instanceof ModuleComponentIdentifier) {
            ModuleComponentSelector requestedModuleComponentSelector = (ModuleComponentSelector)requested;
            ModuleComponentIdentifier selectedModuleComponentedIdentifier = (ModuleComponentIdentifier)selected;

            if(isSameGroupAndModuleButDifferentVersion(requestedModuleComponentSelector, selectedModuleComponentedIdentifier)) {
                return getSimpleName() + " -> " + selectedModuleComponentedIdentifier.getVersion();
            }
        }

        return getSimpleName() + " -> " + selected.getDisplayName();
    }
View Full Code Here

    private final ComponentIdentifierSerializer componentIdSerializer = new ComponentIdentifierSerializer();

    public ModuleVersionSelection read(Decoder decoder) throws IOException {
        ModuleVersionIdentifier id = idSerializer.read(decoder);
        ComponentSelectionReason reason = reasonSerializer.read(decoder);
        ComponentIdentifier componentId = componentIdSerializer.read(decoder);
        return new DefaultModuleVersionSelection(id, reason, componentId);
    }
View Full Code Here

                    type = decoder.readByte();
                    valuesRead++;
                    switch (type) {
                        case ROOT:
                            ModuleVersionIdentifier id = moduleVersionIdentifierSerializer.read(decoder);
                            ComponentIdentifier componentIdentifier = componentIdentifierSerializer.read(decoder);
                            builder.start(id, componentIdentifier);
                            break;
                        case MODULE:
                            ModuleVersionSelection sel = moduleVersionSelectionSerializer.read(decoder);
                            builder.resolvedModuleVersion(sel);
View Full Code Here

TOP

Related Classes of org.gradle.api.artifacts.component.ComponentIdentifier

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.