• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ModuleComponentIdentifier类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.gradle.api.artifacts.component.ModuleComponentIdentifier的典型用法代码示例。如果您正苦于以下问题:Java ModuleComponentIdentifier类的具体用法?Java ModuleComponentIdentifier怎么用?Java ModuleComponentIdentifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ModuleComponentIdentifier类属于org.gradle.api.artifacts.component包,在下文中一共展示了ModuleComponentIdentifier类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: forIvyModuleDescriptor

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
public static ModuleDescriptorState forIvyModuleDescriptor(ModuleDescriptor ivyDescriptor) {
    ModuleRevisionId moduleRevisionId = ivyDescriptor.getModuleRevisionId();
    ModuleComponentIdentifier componentIdentifier = DefaultModuleComponentIdentifier.newId(moduleRevisionId.getOrganisation(), moduleRevisionId.getName(), moduleRevisionId.getRevision());
    MutableModuleDescriptorState state = new MutableModuleDescriptorState(componentIdentifier, ivyDescriptor.getStatus(), ivyDescriptor.isDefault());

    state.setBranch(moduleRevisionId.getBranch());
    state.setDescription(ivyDescriptor.getDescription());
    state.setPublicationDate(ivyDescriptor.getPublicationDate());
    Map<NamespaceId, String> extraInfo = Cast.uncheckedCast(ivyDescriptor.getExtraInfo());
    state.getExtraInfo().putAll(extraInfo);

    for (ExcludeRule excludeRule : ivyDescriptor.getAllExcludeRules()) {
        addExcludeRule(state, excludeRule);
    }

    return state;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:18,代码来源:IvyModuleDescriptorConverter.java


示例2: getIdeRepoFileDependencies

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
/**
 * Gets IDE repository file dependencies.
 *
 * @param configuration Configuration
 * @return IDE repository file dependencies
 */
public List<IdeExtendedRepoFileDependency> getIdeRepoFileDependencies(Configuration configuration) {
    ResolutionResult result = getIncomingResolutionResult(configuration);
    final Set<ResolvedComponentResult> resolvedRepoFileComponents = CollectionUtils.filter(result.getAllComponents(), new Spec<ResolvedComponentResult>() {
        @Override
        public boolean isSatisfiedBy(ResolvedComponentResult element) {
            return element.getId() instanceof ModuleComponentIdentifier;
        }
    });
    Set<ModuleVersionIdentifier> mappedResolvedDependencies = mapResolvedDependencies(resolvedRepoFileComponents);
    Set<ResolvedArtifact> artifacts = getExternalArtifacts(configuration);
    List<IdeExtendedRepoFileDependency> externalDependencies = new ArrayList<IdeExtendedRepoFileDependency>();
    for (ResolvedArtifact artifact : artifacts) {
        if (mappedResolvedDependencies.contains(artifact.getModuleVersion().getId())) {
            IdeExtendedRepoFileDependency ideRepoFileDependency = new IdeExtendedRepoFileDependency(artifact.getFile());
            ideRepoFileDependency.setId(artifact.getModuleVersion().getId());
            externalDependencies.add(ideRepoFileDependency);
        }
    }

    return externalDependencies;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:28,代码来源:DefaultIdeDependencyResolver.java


示例3: getCachedModuleDescriptor

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
public CachedMetaData getCachedModuleDescriptor(ModuleComponentRepository repository, ModuleComponentIdentifier componentId) {
    ModuleComponentAtRepositoryKey key = createKey(repository, componentId);
    ModuleMetadataCacheEntry entry = getCache().get(key);
    if (entry == null) {
        return null;
    }
    if (entry.isMissing()) {
        return new DefaultCachedMetaData(entry, null, timeProvider);
    }
    MutableModuleComponentResolveMetadata metadata = moduleMetadataStore.getModuleDescriptor(key);
    if (metadata == null) {
        // Descriptor file has been deleted - ignore the entry
        getCache().remove(key);
        return null;
    }
    return new DefaultCachedMetaData(entry, entry.configure(metadata), timeProvider);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:18,代码来源:DefaultModuleMetaDataCache.java


示例4: resolveStaticDependency

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
protected final void resolveStaticDependency(ModuleComponentIdentifier moduleVersionIdentifier, ComponentOverrideMetadata prescribedMetaData, BuildableModuleComponentMetaDataResolveResult result, ExternalResourceArtifactResolver artifactResolver) {
    MutableModuleComponentResolveMetadata metaDataArtifactMetaData = parseMetaDataFromArtifact(moduleVersionIdentifier, artifactResolver, result);
    if (metaDataArtifactMetaData != null) {
        LOGGER.debug("Metadata file found for module '{}' in repository '{}'.", moduleVersionIdentifier, getName());
        metaDataArtifactMetaData.setSource(artifactResolver.getSource());
        result.resolved(metaDataArtifactMetaData.asImmutable());
        return;
    }

    MutableModuleComponentResolveMetadata metaDataFromDefaultArtifact = createMetaDataFromDefaultArtifact(moduleVersionIdentifier, prescribedMetaData, artifactResolver, result);
    if (metaDataFromDefaultArtifact != null) {
        LOGGER.debug("Found artifact but no meta-data for module '{}' in repository '{}', using default meta-data.", moduleVersionIdentifier, getName());
        metaDataFromDefaultArtifact.setSource(artifactResolver.getSource());
        result.resolved(metaDataFromDefaultArtifact.asImmutable());
        return;
    }

    LOGGER.debug("No meta-data file or artifact found for module '{}' in repository '{}'.", moduleVersionIdentifier, getName());
    result.missing();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:21,代码来源:ExternalResourceResolver.java


示例5: checkMetadataConsistency

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
protected void checkMetadataConsistency(ModuleComponentIdentifier expectedId, MutableModuleComponentResolveMetadata metadata) throws MetaDataParseException {
    List<String> errors = new ArrayList<String>();
    if (!expectedId.getGroup().equals(metadata.getId().getGroup())) {
        errors.add("bad group: expected='" + expectedId.getGroup() + "' found='" + metadata.getId().getGroup() + "'");
    }
    if (!expectedId.getModule().equals(metadata.getId().getName())) {
        errors.add("bad module name: expected='" + expectedId.getModule() + "' found='" + metadata.getId().getName() + "'");
    }
    if (!expectedId.getVersion().equals(metadata.getId().getVersion())) {
        errors.add("bad version: expected='" + expectedId.getVersion() + "' found='" + metadata.getId().getVersion() + "'");
    }
    if (errors.size() > 0) {
        throw new MetaDataParseException(String.format("inconsistent module metadata found. Descriptor: %s Errors: %s",
            metadata.getId(), Joiner.on(SystemProperties.getInstance().getLineSeparator()).join(errors)));
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:17,代码来源:ExternalResourceResolver.java


示例6: getName

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
@Override
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();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:21,代码来源:AbstractRenderableDependencyResult.java


示例7: printInfoTag

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
private static void printInfoTag(ModuleDescriptorState descriptor, SimpleXmlWriter writer) throws IOException {
    ModuleComponentIdentifier id = descriptor.getComponentIdentifier();
    writer.startElement("info");

    writer.attribute("organisation", id.getGroup());
    writer.attribute("module", id.getModule());
    String branch = descriptor.getBranch();
    if (branch != null) {
        writer.attribute("branch", branch);
    }
    writer.attribute("revision", id.getVersion());
    writer.attribute("status", descriptor.getStatus());

    if (descriptor.isGenerated()) {
        writer.attribute("default", "true");
    }

    printUnusedContent(descriptor, writer);

    for (Map.Entry<NamespaceId, String> entry : descriptor.getExtraInfo().entrySet()) {
        if (entry.getValue() == null || entry.getValue().length() == 0) {
            continue;
        }
        NamespaceId namespaceId = entry.getKey();
        writer.startElement("ns:" + namespaceId.getName());
        writer.attribute("xmlns:ns", namespaceId.getNamespace());
        writer.characters(entry.getValue());
        writer.endElement();
    }

    writer.endElement();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:33,代码来源:IvyXmlModuleDescriptorWriter.java


示例8: resolveComponentMetaData

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
@Override
public void resolveComponentMetaData(ModuleComponentIdentifier moduleComponentIdentifier, ComponentOverrideMetadata requestMetaData, BuildableModuleComponentMetaDataResolveResult result) {
    try {
        delegate.resolveComponentMetaData(moduleComponentIdentifier, requestMetaData, result);
    } catch (Throwable throwable) {
        result.failed(new ModuleVersionResolveException(moduleComponentIdentifier, throwable));
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:ErrorHandlingModuleComponentRepository.java


示例9: resolveComponentMetaData

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
@Override
public void resolveComponentMetaData(ModuleComponentIdentifier moduleComponentIdentifier, ComponentOverrideMetadata requestMetaData, BuildableModuleComponentMetaDataResolveResult result) {
    super.resolveComponentMetaData(moduleComponentIdentifier, requestMetaData, result);
    if (result.getState() == BuildableModuleComponentMetaDataResolveResult.State.Resolved) {
        transformDependencies(result);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:IvyDynamicResolveModuleComponentRepositoryAccess.java


示例10: resolve

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
public void resolve(ComponentIdentifier identifier, ComponentOverrideMetadata componentOverrideMetadata, BuildableComponentResolveResult result) {
    if (!(identifier instanceof ModuleComponentIdentifier)) {
        throw new UnsupportedOperationException("Can resolve meta-data for module components only.");
    }

    resolveModule((ModuleComponentIdentifier) identifier, componentOverrideMetadata, result);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:RepositoryChainComponentMetaDataResolver.java


示例11: resolveModule

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
private void resolveModule(ModuleComponentIdentifier identifier, ComponentOverrideMetadata componentOverrideMetadata, BuildableComponentResolveResult result) {
    LOGGER.debug("Attempting to resolve component for {} using repositories {}", identifier, repositoryNames);

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

    List<ComponentMetaDataResolveState> resolveStates = new ArrayList<ComponentMetaDataResolveState>();
    for (ModuleComponentRepository repository : repositories) {
        resolveStates.add(new ComponentMetaDataResolveState(identifier, componentOverrideMetadata, repository, versionedComponentChooser));
    }

    final RepositoryChainModuleResolution latestResolved = findBestMatch(resolveStates, errors);
    if (latestResolved != null) {
        LOGGER.debug("Using {} from {}", latestResolved.module.getId(), latestResolved.repository);
        for (Throwable error : errors) {
            LOGGER.debug("Discarding resolve failure.", error);
        }

        result.resolved(metaDataFactory.transform(latestResolved));
        return;
    }
    if (!errors.isEmpty()) {
        result.failed(new ModuleVersionResolveException(identifier, errors));
    } else {
        for (ComponentMetaDataResolveState resolveState : resolveStates) {
            resolveState.applyTo(result);
        }
        result.notFound(identifier);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:30,代码来源:RepositoryChainComponentMetaDataResolver.java


示例12: getModuleIdentifier

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
private ModuleIdentifier getModuleIdentifier(RenderableDependency renderableDependency) {
    if (renderableDependency.getId() instanceof ModuleComponentIdentifier) {
        ModuleComponentIdentifier id = (ModuleComponentIdentifier) renderableDependency.getId();
        return new DefaultModuleIdentifier(id.getGroup(), id.getModule());
    }
    return null;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:JsonProjectDependencyRenderer.java


示例13: resolveComponentMetaData

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
@Override
public void resolveComponentMetaData(ModuleComponentIdentifier moduleComponentIdentifier, ComponentOverrideMetadata requestMetaData, BuildableModuleComponentMetaDataResolveResult result) {
    if (!metaDataCache.supplyMetaData(moduleComponentIdentifier, result)) {
        super.resolveComponentMetaData(moduleComponentIdentifier, requestMetaData, result);
        metaDataCache.newDependencyResult(moduleComponentIdentifier, result);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:InMemoryCachedModuleComponentRepository.java


示例14: supplyMetaData

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
boolean supplyMetaData(ModuleComponentIdentifier requested, BuildableModuleComponentMetaDataResolveResult result) {
    CachedModuleVersionResult fromCache = metaData.get(requested);
    if (fromCache == null) {
        return false;
    }
    fromCache.supply(result);
    return true;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:InMemoryMetaDataCache.java


示例15: resolveComponentMetaData

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
@Override
public void resolveComponentMetaData(ModuleComponentIdentifier moduleComponentIdentifier, ComponentOverrideMetadata requestMetaData, BuildableModuleComponentMetaDataResolveResult result) {
    // First try to determine the artifacts in-memory (e.g using the metadata): don't use the cache in this case
    delegate.getLocalAccess().resolveComponentMetaData(moduleComponentIdentifier, requestMetaData, result);
    if (result.hasResult()) {
        return;
    }

    resolveComponentMetaDataFromCache(moduleComponentIdentifier, requestMetaData, result);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:CachingModuleComponentRepository.java


示例16: matchesSelected

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
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());
    }

    return false;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:StrictDependencyResultSpec.java


示例17: selectNewestMatchingComponent

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
public void selectNewestMatchingComponent(Collection<? extends ModuleComponentResolveState> versions, BuildableComponentSelectionResult result, ModuleVersionSelector requested) {
    VersionSelector requestedVersion = versionSelectorScheme.parseSelector(requested.getVersion());
    Collection<SpecRuleAction<? super ComponentSelection>> rules = componentSelectionRules.getRules();

    for (ModuleComponentResolveState candidate : sortLatestFirst(versions)) {
        MetadataProvider metadataProvider = new MetadataProvider(candidate);

        boolean versionMatches = versionMatches(requestedVersion, candidate, metadataProvider);
        if (!metadataProvider.isUsable()) {
            applyTo(metadataProvider, result);
            return;
        }
        if (!versionMatches) {
            result.notMatched(candidate.getVersion());
            continue;
        }

        ModuleComponentIdentifier candidateIdentifier = candidate.getId();
        boolean accepted = !isRejectedByRules(candidateIdentifier, rules, metadataProvider);
        if (!metadataProvider.isUsable()) {
            applyTo(metadataProvider, result);
            return;
        }

        if (accepted) {
            result.matches(candidateIdentifier);
            return;
        }

        result.rejected(candidate.getVersion());
        if (requestedVersion.matchesUniqueVersion()) {
            // Only consider one candidate
            break;
        }
    }

    result.noMatchFound();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:39,代码来源:DefaultVersionedComponentChooser.java


示例18: resolveComponentMetaData

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
@Override
public void resolveComponentMetaData(ModuleComponentIdentifier moduleComponentIdentifier, ComponentOverrideMetadata requestMetaData, BuildableModuleComponentMetaDataResolveResult result) {
    delegate.getLocalAccess().resolveComponentMetaData(moduleComponentIdentifier, requestMetaData, result);
    if (!result.hasResult()) {
        delegate.getRemoteAccess().resolveComponentMetaData(moduleComponentIdentifier, requestMetaData, result);
    }

    if (result.getState() == BuildableModuleComponentMetaDataResolveResult.State.Resolved) {
        result.setMetadata(metadataProcessor.processMetadata(result.getMetaData()));
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:LocalModuleComponentRepository.java


示例19: ModuleDescriptorState

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
public ModuleDescriptorState(ModuleComponentIdentifier componentIdentifier, String status, boolean generated) {
    this.componentIdentifier = componentIdentifier;
    branch = null;
    description = null;
    publicationDate = new Date();
    this.status = status;
    this.generated = generated;
    extraInfo = Maps.newHashMap();
    excludes = Lists.newArrayList();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:ModuleDescriptorState.java


示例20: AbstractMutableModuleComponentResolveMetadata

import org.gradle.api.artifacts.component.ModuleComponentIdentifier; //导入依赖的package包/类
protected AbstractMutableModuleComponentResolveMetadata(ModuleComponentIdentifier componentIdentifier, ModuleDescriptorState moduleDescriptor, Map<String, Configuration> configurations, List<? extends DependencyMetadata> dependencies) {
    this.descriptor = moduleDescriptor;
    this.componentId = componentIdentifier;
    this.id = DefaultModuleVersionIdentifier.newId(componentIdentifier);
    this.status = moduleDescriptor.getStatus();
    this.dependencies = dependencies;
    this.configurationDefinitions = configurations;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:AbstractMutableModuleComponentResolveMetadata.java



注:本文中的org.gradle.api.artifacts.component.ModuleComponentIdentifier类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SWebHdfsFileSystem类代码示例发布时间:2022-05-23
下一篇:
Java CombinedIPWhiteList类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap