Java 类org.gradle.api.internal.artifacts.DefaultModuleIdentifier 实例源码

项目:Reer    文件:PomReader.java   
public List<ModuleIdentifier> getExcludedModules() {
    Element exclusionsElement = getFirstChildElement(depElement, EXCLUSIONS);
    if (exclusionsElement != null) {
        NodeList childs = exclusionsElement.getChildNodes();
        List<ModuleIdentifier> exclusions = Lists.newArrayList();
        for (int i = 0; i < childs.getLength(); i++) {
            Node node = childs.item(i);
            if (node instanceof Element && EXCLUSION.equals(node.getNodeName())) {
                String groupId = getFirstChildText((Element) node, GROUP_ID);
                String artifactId = getFirstChildText((Element) node, ARTIFACT_ID);
                if ((groupId != null) && (artifactId != null)) {
                    exclusions.add(DefaultModuleIdentifier.newId(groupId, artifactId));
                }
            }
        }
        return exclusions;
    }
    return Collections.emptyList();
}
项目:Reer    文件:CompositeBuildDependencySubstitutions.java   
private ProjectComponentIdentifier getReplacementFor(ModuleComponentSelector selector) {
    ModuleIdentifier candidateId = DefaultModuleIdentifier.newId(selector.getGroup(), selector.getModule());
    Collection<ProjectComponentIdentifier> providingProjects = replacementMap.get(candidateId);
    if (providingProjects.isEmpty()) {
        LOGGER.info("Found no composite build substitute for module '" + candidateId + "'.");
        return null;
    }
    if (providingProjects.size() == 1) {
        ProjectComponentIdentifier match = providingProjects.iterator().next();
        LOGGER.info("Found project '" + match + "' as substitute for module '" + candidateId + "'.");
        return match;
    }
    SortedSet<String> sortedProjects = Sets.newTreeSet(CollectionUtils.collect(providingProjects, new Transformer<String, ProjectComponentIdentifier>() {
        @Override
        public String transform(ProjectComponentIdentifier projectComponentIdentifier) {
            return projectComponentIdentifier.getDisplayName();
        }
    }));
    String failureMessage = String.format("Module version '%s' is not unique in composite: can be provided by %s.", selector.getDisplayName(), sortedProjects);
    throw new ModuleVersionResolveException(selector, failureMessage);
}
项目:Pushjet-Android    文件:ExternalResourceResolver.java   
public void listModuleVersions(DependencyMetaData dependency, BuildableModuleVersionSelectionResolveResult result) {
    ModuleIdentifier module  = new DefaultModuleIdentifier(dependency.getRequested().getGroup(), dependency.getRequested().getName());
    VersionList versionList = versionLister.getVersionList(module);
    // List modules based on metadata files
    ModuleVersionArtifactMetaData metaDataArtifact = getMetaDataArtifactFor(dependency);
    listVersionsForAllPatterns(getIvyPatterns(), metaDataArtifact, versionList);

    // List modules with missing metadata files
    if (isAllownomd()) {
        for (ModuleVersionArtifactMetaData otherArtifact : getDefaultMetaData(dependency).getArtifacts()) {
            listVersionsForAllPatterns(getArtifactPatterns(), otherArtifact, versionList);
        }
    }
    DefaultModuleVersionListing moduleVersions = new DefaultModuleVersionListing();
    for (VersionList.ListedVersion listedVersion : versionList.getVersions()) {
        moduleVersions.add(listedVersion.getVersion());
    }
    result.listed(moduleVersions);
}
项目:Reer    文件:ModuleForcingResolveRule.java   
public ModuleForcingResolveRule(Collection<? extends ModuleVersionSelector> forcedModules) {
    if (!forcedModules.isEmpty()) {
        this.forcedModules = new HashMap<ModuleIdentifier, String>();
        for (ModuleVersionSelector module : forcedModules) {
            this.forcedModules.put(new DefaultModuleIdentifier(module.getGroup(), module.getName()), module.getVersion());
        }
    } else {
        this.forcedModules = null;
    }
}
项目:Reer    文件:ModuleForcingResolveRule.java   
@Override
public void execute(DependencySubstitutionInternal details) {
    if (forcedModules == null) {
        return;
    }
    ModuleIdentifier key = new DefaultModuleIdentifier(details.getOldRequested().getGroup(), details.getOldRequested().getName());
    if (forcedModules.containsKey(key) && details.getRequested() instanceof ModuleComponentSelector) {
        details.useTarget(DefaultModuleComponentSelector.newSelector(key.getGroup(), key.getName(), forcedModules.get(key)), VersionSelectionReasons.FORCED);
    }
}
项目:Reer    文件:DependencyGraphBuilder.java   
private boolean isExcluded(ModuleExclusion selector, DependencyMetadata dependency) {
    if (!resolveState.edgeFilter.isSatisfiedBy(dependency)) {
        LOGGER.debug("{} is filtered.", dependency);
        return true;
    }
    ModuleIdentifier targetModuleId = DefaultModuleIdentifier.newId(dependency.getRequested().getGroup(), dependency.getRequested().getName());
    if (selector.excludeModule(targetModuleId)) {
        LOGGER.debug("{} is excluded from {}.", targetModuleId, this);
        return true;
    }

    return false;
}
项目:Reer    文件:ExternalResourceResolver.java   
private void doListModuleVersions(DependencyMetadata dependency, BuildableModuleVersionListingResolveResult result) {
    ModuleIdentifier module = new DefaultModuleIdentifier(dependency.getRequested().getGroup(), dependency.getRequested().getName());
    Set<String> versions = new LinkedHashSet<String>();
    VersionPatternVisitor visitor = versionLister.newVisitor(module, versions, result);

    // List modules based on metadata files (artifact version is not considered in listVersionsForAllPatterns())
    IvyArtifactName metaDataArtifact = getMetaDataArtifactName(dependency.getRequested().getName());
    listVersionsForAllPatterns(ivyPatterns, metaDataArtifact, visitor);

    // List modules with missing metadata files
    for (IvyArtifactName otherArtifact : getDependencyArtifactNames(dependency.getRequested().getName(), dependency.getArtifacts())) {
        listVersionsForAllPatterns(artifactPatterns, otherArtifact, visitor);
    }
    result.listed(versions);
}
项目:Reer    文件:JsonProjectDependencyRenderer.java   
private ModuleIdentifier getModuleIdentifier(RenderableDependency renderableDependency) {
    if (renderableDependency.getId() instanceof ModuleComponentIdentifier) {
        ModuleComponentIdentifier id = (ModuleComponentIdentifier) renderableDependency.getId();
        return new DefaultModuleIdentifier(id.getGroup(), id.getModule());
    }
    return null;
}
项目:atlas    文件:ApDependencies.java   
private Map<ModuleIdentifier, String> getAwbDependencies(String awb) {
    ParsedModuleStringNotation parsedNotation = new ParsedModuleStringNotation(awb);
    String group = parsedNotation.getGroup();
    String name = parsedNotation.getName();
    ModuleIdentifier moduleIdentifier = DefaultModuleIdentifier.newId(group, name);
    Map<ModuleIdentifier, String> awbDependencies = mAwbDependenciesMap.get(moduleIdentifier);
    if (awbDependencies == null) {
        awbDependencies = Maps.newHashMap();
        mAwbDependenciesMap.put(moduleIdentifier, awbDependencies);
    }
    return awbDependencies;
}
项目:atlas    文件:ApDependencies.java   
private void addDependency(String dependencyString, Map<ModuleIdentifier, String> awb) {
    ParsedModuleStringNotation parsedNotation = new ParsedModuleStringNotation(dependencyString);
    ModuleIdentifier moduleIdentifier = DefaultModuleIdentifier.newId(parsedNotation.getGroup(),
                                                                      parsedNotation.getName());
    String version = parsedNotation.getVersion();
    awb.put(moduleIdentifier, version);
    mFlatDependenciesMap.put(moduleIdentifier, version);
}
项目:Pushjet-Android    文件:ModuleForcingResolveRule.java   
public ModuleForcingResolveRule(Collection<? extends ModuleVersionSelector> forcedModules) {
    if (!forcedModules.isEmpty()) {
        this.forcedModules = new HashMap<ModuleIdentifier, String>();
        for (ModuleVersionSelector module : forcedModules) {
            this.forcedModules.put(new DefaultModuleIdentifier(module.getGroup(), module.getName()), module.getVersion());
        }
    } else {
        this.forcedModules = null;
    }
}
项目:Pushjet-Android    文件:ModuleForcingResolveRule.java   
public void execute(DependencyResolveDetailsInternal details) {
    if (forcedModules == null) {
        return;
    }
    ModuleIdentifier key = new DefaultModuleIdentifier(details.getRequested().getGroup(), details.getRequested().getName());
    if (forcedModules.containsKey(key)) {
        details.useVersion(forcedModules.get(key), VersionSelectionReasons.FORCED);
    }
}
项目:Pushjet-Android    文件:ExternalResourceResolver.java   
private void doListModuleVersions(DependencyMetaData dependency, BuildableModuleComponentVersionSelectionResolveResult result) {
    ModuleIdentifier module  = new DefaultModuleIdentifier(dependency.getRequested().getGroup(), dependency.getRequested().getName());
    Set<String> versions = new LinkedHashSet<String>();
    VersionPatternVisitor visitor = versionLister.newVisitor(module, versions, result);

    // List modules based on metadata files (artifact version is not considered in listVersionsForAllPatterns())
    IvyArtifactName metaDataArtifact = getMetaDataArtifactName(dependency.getRequested().getName());
    listVersionsForAllPatterns(ivyPatterns, metaDataArtifact, visitor);

    // List modules with missing metadata files
    for (IvyArtifactName otherArtifact : getDependencyArtifactNames(dependency)) {
        listVersionsForAllPatterns(artifactPatterns, otherArtifact, visitor);
    }
    result.listed(versions);
}
项目:Pushjet-Android    文件:ModuleForcingResolveRule.java   
public ModuleForcingResolveRule(Collection<? extends ModuleVersionSelector> forcedModules) {
    if (!forcedModules.isEmpty()) {
        this.forcedModules = new HashMap<ModuleIdentifier, String>();
        for (ModuleVersionSelector module : forcedModules) {
            this.forcedModules.put(new DefaultModuleIdentifier(module.getGroup(), module.getName()), module.getVersion());
        }
    } else {
        this.forcedModules = null;
    }
}
项目:Pushjet-Android    文件:ModuleForcingResolveRule.java   
public void execute(DependencyResolveDetailsInternal details) {
    if (forcedModules == null) {
        return;
    }
    ModuleIdentifier key = new DefaultModuleIdentifier(details.getRequested().getGroup(), details.getRequested().getName());
    if (forcedModules.containsKey(key)) {
        details.useVersion(forcedModules.get(key), VersionSelectionReasons.FORCED);
    }
}
项目:Reer    文件:SingleFileBackedModuleVersionsCache.java   
public ModuleKey read(Decoder decoder) throws Exception {
    String resolverId = decoder.readString();
    String group = decoder.readString();
    String module = decoder.readString();
    return new ModuleKey(resolverId, new DefaultModuleIdentifier(group, module));
}
项目:Reer    文件:UnversionedModuleComponentSelector.java   
UnversionedModuleComponentSelector(String group, String name) {
    this.moduleIdentifier = DefaultModuleIdentifier.newId(group, name);
}
项目:Reer    文件:CachingModuleComponentRepository.java   
private DefaultModuleIdentifier getCacheKey(ModuleVersionSelector requested) {
    return new DefaultModuleIdentifier(requested.getGroup(), requested.getName());
}
项目:Reer    文件:ModuleIdExcludeSpec.java   
public ModuleIdExcludeSpec(String group, String name) {
    this.moduleId = DefaultModuleIdentifier.newId(group, name);
}
项目:Reer    文件:DependencyGraphBuilder.java   
private ModuleVersionSelectorResolveState(DependencyMetadata dependencyMetadata, DependencyToComponentIdResolver resolver, ResolveState resolveState) {
    this.dependencyMetadata = dependencyMetadata;
    this.resolver = resolver;
    this.resolveState = resolveState;
    targetModule = resolveState.getModule(new DefaultModuleIdentifier(dependencyMetadata.getRequested().getGroup(), dependencyMetadata.getRequested().getName()));
}
项目:Reer    文件:DefaultExclude.java   
public DefaultExclude(String group, String module, String artifact, String type, String extension, String[] configurations, String patternMatcher) {
    this.moduleId = DefaultModuleIdentifier.newId(group, module);
    this.artifact = new DefaultIvyArtifactName(artifact, type, extension);
    this.configurations = ImmutableSet.copyOf(configurations);
    this.patternMatcher = patternMatcher;
}
项目:Reer    文件:DefaultExclude.java   
public DefaultExclude(String group, String module, String[] configurations, String patternMatcher) {
    this.moduleId = DefaultModuleIdentifier.newId(group, module);
    this.artifact = new DefaultIvyArtifactName(PatternMatchers.ANY_EXPRESSION, PatternMatchers.ANY_EXPRESSION, PatternMatchers.ANY_EXPRESSION);
    this.configurations = ImmutableSet.copyOf(configurations);
    this.patternMatcher = patternMatcher;
}
项目:Reer    文件:DefaultExclude.java   
public DefaultExclude(String group, String module) {
    this.moduleId = DefaultModuleIdentifier.newId(group, module);
    this.artifact = new DefaultIvyArtifactName(PatternMatchers.ANY_EXPRESSION, PatternMatchers.ANY_EXPRESSION, PatternMatchers.ANY_EXPRESSION);
    this.configurations = ImmutableSet.of();
    this.patternMatcher = PatternMatchers.EXACT;
}
项目:atlas    文件:ApDependencies.java   
public Map<ModuleIdentifier, String> getAwbDependencies(String group, String name) {
    ModuleIdentifier moduleIdentifier = DefaultModuleIdentifier.newId(group, name);
    Map<ModuleIdentifier, String> awbDependencies = mAwbDependenciesMap.get(moduleIdentifier);
    return awbDependencies;
}
项目:atlas    文件:ApDependencies.java   
public boolean isMainLibrary(ResolvedDependencyInfo dependencyInfo) {
    return mMainDependenciesMap.containsKey(
        DefaultModuleIdentifier.newId(dependencyInfo.getGroup(), dependencyInfo.getName()));
}
项目:Pushjet-Android    文件:SingleFileBackedModuleVersionsCache.java   
public ModuleKey read(Decoder decoder) throws Exception {
    String resolverId = decoder.readString();
    String group = decoder.readString();
    String module = decoder.readString();
    return new ModuleKey(resolverId, new DefaultModuleIdentifier(group, module));
}
项目:Pushjet-Android    文件:CachingModuleComponentRepository.java   
private DefaultModuleIdentifier getCacheKey(ModuleVersionSelector requested) {
    return new DefaultModuleIdentifier(requested.getGroup(), requested.getName());
}
项目:Pushjet-Android    文件:DependencyGraphBuilder.java   
private ModuleVersionSelectorResolveState(DependencyMetaData dependencyMetaData, DependencyToComponentIdResolver resolver, ResolveState resolveState) {
    this.dependencyMetaData = dependencyMetaData;
    this.resolver = resolver;
    this.resolveState = resolveState;
    targetModule = resolveState.getModule(new DefaultModuleIdentifier(dependencyMetaData.getRequested().getGroup(), dependencyMetaData.getRequested().getName()));
}
项目:Pushjet-Android    文件:SingleFileBackedModuleVersionsCache.java   
public ModuleKey read(Decoder decoder) throws Exception {
    String resolverId = decoder.readString();
    String group = decoder.readString();
    String module = decoder.readString();
    return new ModuleKey(resolverId, new DefaultModuleIdentifier(group, module));
}
项目:Pushjet-Android    文件:ResolveIvyFactory.java   
public ModuleIdentifier transform(ModuleVersionSelector original) {
    return new DefaultModuleIdentifier(original.getGroup(), original.getName());
}
项目:Pushjet-Android    文件:ResolveIvyFactory.java   
public ModuleIdentifier transform(ModuleVersionSelector original) {
    return new DefaultModuleIdentifier(original.getGroup(), original.getName() + ":" + original.getVersion());
}
项目:Pushjet-Android    文件:DependencyGraphBuilder.java   
private ModuleVersionSelectorResolveState(DependencyMetaData dependencyMetaData, DependencyToModuleVersionIdResolver resolver, ResolveState resolveState) {
    this.dependencyMetaData = dependencyMetaData;
    this.resolver = resolver;
    this.resolveState = resolveState;
    targetModule = resolveState.getModule(new DefaultModuleIdentifier(dependencyMetaData.getRequested().getGroup(), dependencyMetaData.getRequested().getName()));
}