当前位置: 首页>>代码示例>>Java>>正文


Java ComponentIdentifier类代码示例

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


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


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