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

Java ComponentIdentifier类代码示例

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

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



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

示例1: visitFiles

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
@Override
public void visitFiles(@Nullable ComponentIdentifier componentIdentifier, Iterable<File> files) {
    try {
        for (File file : files) {
            if (seenFiles.add(file)) {
                ComponentArtifactIdentifier artifactIdentifier;
                if (componentIdentifier == null) {
                    artifactIdentifier = new OpaqueComponentArtifactIdentifier(file);
                } else {
                    artifactIdentifier = new ComponentFileArtifactIdentifier(componentIdentifier, file.getName());
                }
                artifacts.add(new DefaultResolvedArtifactResult(artifactIdentifier, Artifact.class, file));
            }
        }
    } catch (Throwable t) {
        failures.add(t);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:19,代码来源:DefaultLenientConfiguration.java


示例2: resolve

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
public void resolve(ComponentIdentifier identifier, ComponentOverrideMetadata componentOverrideMetadata, BuildableComponentResolveResult result) {
    resolver.resolve(identifier, componentOverrideMetadata, result);

    if (result.getFailure() != null) {
        return;
    }
    ClientModule clientModule = componentOverrideMetadata.getClientModule();
    if (clientModule != null) {
        MutableModuleComponentResolveMetadata clientModuleMetaData = ((ModuleComponentResolveMetadata)result.getMetaData()).asMutable();
        addClientModuleDependencies(clientModule, clientModuleMetaData);

        setClientModuleArtifact(clientModuleMetaData);

        result.setMetaData(clientModuleMetaData.asImmutable());
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:17,代码来源:ClientModuleResolver.java


示例3: getName

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的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


示例4: resolveArtifacts

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
@Override
public void resolveArtifacts(ComponentResolveMetadata component, BuildableComponentArtifactsResolveResult result) {
    ComponentIdentifier componentId = component.getComponentId();
    if (isLibrary(componentId)) {
        result.resolved(new MetadataSourcedComponentArtifacts());
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:LocalLibraryDependencyResolver.java


示例5: emptyGraph

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
private void emptyGraph(ConfigurationInternal configuration, ResolverResults results) {
    Module module = configuration.getModule();
    ModuleVersionIdentifier id = DefaultModuleVersionIdentifier.newId(module);
    ComponentIdentifier componentIdentifier = componentIdentifierFactory.createComponentIdentifier(module);
    ResolutionResult emptyResult = DefaultResolutionResultBuilder.empty(id, componentIdentifier);
    ResolvedLocalComponentsResult emptyProjectResult = new ResolvedLocalComponentsResultGraphVisitor();
    results.graphResolved(emptyResult, emptyProjectResult, new EmptyResults());
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:ShortCircuitEmptyConfigurationResolver.java


示例6: resolve

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
@Override
public void resolve(ComponentIdentifier identifier, ComponentOverrideMetadata componentOverrideMetadata, BuildableComponentResolveResult result) {
    if (identifier instanceof ProjectComponentIdentifier) {
        ProjectComponentIdentifier projectId = (ProjectComponentIdentifier) identifier;
        LocalComponentMetadata componentMetaData = localComponentRegistry.getComponent(projectId);
        if (componentMetaData == null) {
            result.failed(new ModuleVersionResolveException(DefaultProjectComponentSelector.newSelector(projectId), projectId + " not found."));
        } else {
            result.resolved(componentMetaData);
        }
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:ProjectDependencyResolver.java


示例7: getLocalComponentMetaData

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
private LocalComponentMetadata getLocalComponentMetaData(ProjectInternal project) {
    Module module = project.getModule();
    ModuleVersionIdentifier moduleVersionIdentifier = DefaultModuleVersionIdentifier.newId(module);
    ComponentIdentifier componentIdentifier = newProjectId(project);
    DefaultLocalComponentMetadata metaData = new DefaultLocalComponentMetadata(moduleVersionIdentifier, componentIdentifier, module.getStatus(), project.getAttributesSchema());
    metaDataBuilder.addConfigurations(metaData, project.getConfigurations().withType(ConfigurationInternal.class));
    return metaData;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:DefaultProjectLocalComponentProvider.java


示例8: resolve

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
@Override
public void resolve(final ComponentIdentifier identifier, final ComponentOverrideMetadata componentOverrideMetadata, final BuildableComponentResolveResult result) {
    cacheLockingManager.useCache("Resolve " + identifier, new Runnable() {
        public void run() {
            delegate.getComponentResolver().resolve(identifier, componentOverrideMetadata, result);
        }
    });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:ResolveIvyFactory.java


示例9: resolve

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的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


示例10: supplyArtifacts

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
public boolean supplyArtifacts(ComponentIdentifier component, ArtifactType type, BuildableArtifactSetResolveResult result) {
    Set<ComponentArtifactMetadata> artifacts = typedArtifacts.get(new TypedArtifactsKey(component, type));
    if (artifacts != null) {
        result.resolved(artifacts);
        return true;
    }
    return false;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:InMemoryArtifactsCache.java


示例11: getCachedArtifacts

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
public CachedArtifacts getCachedArtifacts(ModuleComponentRepository repository, ComponentIdentifier componentId, String context) {
    ModuleArtifactsKey key = new ModuleArtifactsKey(repository.getId(), componentId, context);
    ModuleArtifactsCacheEntry entry = getCache().get(key);
    if (entry == null) {
        return null;
    }
    return createCacheArtifacts(entry);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:DefaultModuleArtifactsCache.java


示例12: resolve

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
@Override
public void resolve(ComponentIdentifier identifier, ComponentOverrideMetadata componentOverrideMetadata, BuildableComponentResolveResult result) {
    for (ComponentMetaDataResolver resolver : resolvers) {
        if (result.hasResult()) {
            return;
        }
        resolver.resolve(identifier, componentOverrideMetadata, result);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:ComponentResolversChain.java


示例13: write

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
public void write(Encoder encoder, ComponentIdentifier value) throws IOException {
    if (value == null) {
        throw new IllegalArgumentException("Provided component identifier may not be null");
    }

    Implementation implementation = resolveImplementation(value);

    encoder.writeByte(implementation.getId());

    if (implementation == Implementation.MODULE) {
        ModuleComponentIdentifier moduleComponentIdentifier = (ModuleComponentIdentifier) value;
        encoder.writeString(moduleComponentIdentifier.getGroup());
        encoder.writeString(moduleComponentIdentifier.getModule());
        encoder.writeString(moduleComponentIdentifier.getVersion());
    } else if (implementation == Implementation.BUILD) {
        ProjectComponentIdentifier projectComponentIdentifier = (ProjectComponentIdentifier) value;
        BuildIdentifier build = projectComponentIdentifier.getBuild();
        buildIdentifierSerializer.write(encoder, build);
        encoder.writeString(projectComponentIdentifier.getProjectPath());
    } else if (implementation == Implementation.LIBRARY) {
        LibraryBinaryIdentifier libraryIdentifier = (LibraryBinaryIdentifier) value;
        encoder.writeString(libraryIdentifier.getProjectPath());
        encoder.writeString(libraryIdentifier.getLibraryName());
        encoder.writeString(libraryIdentifier.getVariant());
    } else {
        throw new IllegalStateException("Unsupported implementation type: " + implementation);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:29,代码来源:ComponentIdentifierSerializer.java


示例14: resolveImplementation

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
private Implementation resolveImplementation(ComponentIdentifier value) {
    Implementation implementation;
    if (value instanceof ModuleComponentIdentifier) {
        implementation = Implementation.MODULE;
    } else if (value instanceof ProjectComponentIdentifier) {
        implementation = Implementation.BUILD;
    } else if (value instanceof LibraryBinaryIdentifier) {
        implementation = Implementation.LIBRARY;
    } else {
        throw new IllegalArgumentException("Unsupported component identifier class: " + value.getClass());
    }
    return implementation;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:14,代码来源:ComponentIdentifierSerializer.java


示例15: downloadAuxiliaryArtifacts

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
private static void downloadAuxiliaryArtifacts(DependencyHandler dependencyHandler, Multimap<ComponentIdentifier, IdeExtendedRepoFileDependency> dependencies, List<Class<? extends Artifact>> artifactTypes) {
    if (artifactTypes.isEmpty()) {
        return;
    }

    ArtifactResolutionQuery query = dependencyHandler.createArtifactResolutionQuery();
    query.forComponents(dependencies.keySet());

    @SuppressWarnings("unchecked") Class<? extends Artifact>[] artifactTypesArray = (Class<? extends Artifact>[]) artifactTypes.toArray(new Class<?>[0]);
    query.withArtifacts(JvmLibrary.class, artifactTypesArray);
    Set<ComponentArtifactsResult> componentResults = query.execute().getResolvedComponents();
    for (ComponentArtifactsResult componentResult : componentResults) {
        for (IdeExtendedRepoFileDependency dependency : dependencies.get(componentResult.getId())) {
            for (ArtifactResult sourcesResult : componentResult.getArtifacts(SourcesArtifact.class)) {
                if (sourcesResult instanceof ResolvedArtifactResult) {
                    dependency.addSourceFile(((ResolvedArtifactResult) sourcesResult).getFile());
                }
            }

            for (ArtifactResult javadocResult : componentResult.getArtifacts(JavadocArtifact.class)) {
                if (javadocResult instanceof ResolvedArtifactResult) {
                    dependency.addJavadocFile(((ResolvedArtifactResult) javadocResult).getFile());
                }
            }
        }
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:28,代码来源:IdeDependenciesExtractor.java


示例16: read

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
public ComponentResult read(Decoder decoder) throws IOException {
    long resultId = decoder.readSmallLong();
    ModuleVersionIdentifier id = idSerializer.read(decoder);
    ComponentSelectionReason reason = reasonSerializer.read(decoder);
    ComponentIdentifier componentId = componentIdSerializer.read(decoder);
    return new DefaultComponentResult(resultId, id, reason, componentId);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:ComponentResultSerializer.java


示例17: visitNode

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
@Override
public void visitNode(DependencyGraphNode resolvedConfiguration) {
    ComponentIdentifier componentId = resolvedConfiguration.getOwner().getComponentId();
    if (!rootId.equals(componentId) && componentId instanceof ProjectComponentIdentifier) {
        resolvedProjectConfigurations.add(new DefaultResolvedProjectConfiguration((ProjectComponentIdentifier) componentId, resolvedConfiguration.getResolvedConfigurationId().getConfiguration()));
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:ResolvedLocalComponentsResultGraphVisitor.java


示例18: buildComponentResult

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
private ComponentArtifactsResult buildComponentResult(ComponentIdentifier componentId, ComponentMetaDataResolver componentMetaDataResolver, ArtifactResolver artifactResolver) {
    BuildableComponentResolveResult moduleResolveResult = new DefaultBuildableComponentResolveResult();
    componentMetaDataResolver.resolve(componentId, new DefaultComponentOverrideMetadata(), moduleResolveResult);
    ComponentResolveMetadata component = moduleResolveResult.getMetaData();
    DefaultComponentArtifactsResult componentResult = new DefaultComponentArtifactsResult(component.getComponentId());
    for (Class<? extends Artifact> artifactType : artifactTypes) {
        addArtifacts(componentResult, artifactType, component, artifactResolver);
    }
    return componentResult;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:DefaultArtifactResolutionQuery.java


示例19: toRootComponentMetaData

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
public ComponentResolveMetadata toRootComponentMetaData() {
    Module module = getModule();
    ComponentIdentifier componentIdentifier = componentIdentifierFactory.createComponentIdentifier(module);
    ModuleVersionIdentifier moduleVersionIdentifier = DefaultModuleVersionIdentifier.newId(module);
    ProjectInternal project = projectFinder.findProject(module.getProjectPath());
    AttributesSchema schema = project == null ? null : project.getAttributesSchema();
    DefaultLocalComponentMetadata metaData = new DefaultLocalComponentMetadata(moduleVersionIdentifier, componentIdentifier, module.getStatus(), schema);
    configurationComponentMetaDataBuilder.addConfigurations(metaData, configurationsProvider.getAll());
    return metaData;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:DefaultConfiguration.java


示例20: createComponentIdentifier

import org.gradle.api.artifacts.component.ComponentIdentifier; //导入依赖的package包/类
public ComponentIdentifier createComponentIdentifier(Module module) {
    String projectPath = module.getProjectPath();

    if(projectPath != null) {
        return new DefaultProjectComponentIdentifier(buildIdentity.getCurrentBuild(), projectPath);
    }

    return new DefaultModuleComponentIdentifier(module.getGroup(), module.getName(), module.getVersion());
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:DefaultComponentIdentifierFactory.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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