Package org.gradle.api.internal.artifacts

Examples of org.gradle.api.internal.artifacts.DefaultResolvedDependency


        }

        public ConfigurationDetails addConfiguration(IvyNode ivyNode, String configuration) {
            ModuleRevisionId actualId = ivyNode.getResolvedId();
            Set<String> configurations = getConfigurationHierarchy(ivyNode, configuration);
            DefaultResolvedDependency resolvedDependency;
            if (actualId.getAttribute(DependencyDescriptorFactory.PROJECT_PATH_KEY) != null) {
                resolvedDependency = new DefaultResolvedDependency(
                        actualId.getAttribute(DependencyDescriptorFactory.PROJECT_PATH_KEY),
                        actualId.getOrganisation(), actualId.getName(), actualId.getRevision(),
                        configuration, getArtifacts(ivyNode));
            } else {
                resolvedDependency = new DefaultResolvedDependency(
                        actualId.getOrganisation(), actualId.getName(), actualId.getRevision(),
                        configuration, getArtifacts(ivyNode));
            }
            for (ResolvedArtifact resolvedArtifact : resolvedDependency.getModuleArtifacts()) {
                ((DefaultResolvedArtifact) resolvedArtifact).setResolvedDependency(resolvedDependency);
            }
            ConfigurationDetails configurationDetails = new ConfigurationDetails(resolvedDependency, ivyNode,
                    configurations);
            this.configurations.put(resolvedDependency.getId(), configurationDetails);

            // Collect top level dependencies
            ResolvedConfigurationIdentifier originalId = new ResolvedConfigurationIdentifier(ivyNode.getId(),
                    configuration);
            if (firstLevelDependenciesModuleRevisionIds.containsKey(originalId)) {
View Full Code Here


        for (IvyNode node : resolvedNodes) {
            attachToParents(node, context);
        }

        if (context.root == null) {
            context.root = new DefaultResolvedDependency(resolveReport.getModuleDescriptor().getModuleRevisionId().getOrganisation(),
                    resolveReport.getModuleDescriptor().getModuleRevisionId().getName(),
                    resolveReport.getModuleDescriptor().getModuleRevisionId().getRevision(), configuration.getName(),
                    Collections.EMPTY_SET);
        }
View Full Code Here

                ResolvedConfigurationIdentifier id;
                valuesRead++;
                switch (type) {
                    case NEW_DEP:
                        id = resolvedConfigurationIdentifierSerializer.read(decoder);
                        allDependencies.put(id, new DefaultResolvedDependency(id.getId(), id.getConfiguration()));
                        break;
                    case ROOT:
                        id = resolvedConfigurationIdentifierSerializer.read(decoder);
                        results.root = allDependencies.get(id);
                        if (results.root == null) {
                            throw new IllegalStateException(String.format("Unexpected root id %s. Seen ids: %s", id, allDependencies.keySet()));
                        }
                        //root should be the last
                        LOG.debug("Loaded resolved configuration results ({}) from {}", clock.getTime(), binaryStore);
                        return results;
                    case FIRST_LVL:
                        id = resolvedConfigurationIdentifierSerializer.read(decoder);
                        DefaultResolvedDependency dependency = allDependencies.get(id);
                        if (dependency == null) {
                            throw new IllegalStateException(String.format("Unexpected first level id %s. Seen ids: %s", id, allDependencies.keySet()));
                        }
                        results.firstLevelDependencies.put(mapping.getModuleDependency(id), dependency);
                        break;
                    case PARENT_CHILD:
                        ResolvedConfigurationIdentifier parentId = resolvedConfigurationIdentifierSerializer.read(decoder);
                        ResolvedConfigurationIdentifier childId = resolvedConfigurationIdentifierSerializer.read(decoder);
                        DefaultResolvedDependency parent = allDependencies.get(parentId);
                        DefaultResolvedDependency child = allDependencies.get(childId);
                        if (parent == null) {
                            throw new IllegalStateException(String.format("Unexpected parent dependency id %s. Seen ids: %s", parentId, allDependencies.keySet()));
                        }
                        if (child == null) {
                            throw new IllegalStateException(String.format("Unexpected child dependency id %s. Seen ids: %s", childId, allDependencies.keySet()));
                        }
                        parent.addChild(child);
                        break;
                    case PARENT_ARTIFACT:
                        ResolvedConfigurationIdentifier artifactParentId = resolvedConfigurationIdentifierSerializer.read(decoder);
                        ResolvedConfigurationIdentifier artifactChildId = resolvedConfigurationIdentifierSerializer.read(decoder);
                        DefaultResolvedDependency artifactParent = allDependencies.get(artifactParentId);
                        DefaultResolvedDependency artifactChild = allDependencies.get(artifactChildId);
                        if (artifactParent == null) {
                            throw new IllegalStateException(String.format("Unexpected parent dependency id %s. Seen ids: %s", artifactParentId, allDependencies.keySet()));
                        }
                        if (artifactChild == null) {
                            throw new IllegalStateException(String.format("Unexpected child dependency id %s. Seen ids: %s", artifactChildId, allDependencies.keySet()));
View Full Code Here

TOP

Related Classes of org.gradle.api.internal.artifacts.DefaultResolvedDependency

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.