Search in sources :

Example 1 with DefaultBuildableComponentArtifactsResolveResult

use of org.gradle.internal.resolve.result.DefaultBuildableComponentArtifactsResolveResult in project gradle by gradle.

the class RepositoryChainArtifactResolver method resolveArtifacts.

@Nullable
@Override
public ArtifactSet resolveArtifacts(ComponentResolveMetadata component, ConfigurationMetadata configuration, ArtifactTypeRegistry artifactTypeRegistry, ModuleExclusion exclusions) {
    ModuleComponentRepository sourceRepository = findSourceRepository(component.getSource());
    ComponentResolveMetadata unpackedComponent = unpackSource(component);
    // First try to determine the artifacts locally before going remote
    DefaultBuildableComponentArtifactsResolveResult result = new DefaultBuildableComponentArtifactsResolveResult();
    sourceRepository.getLocalAccess().resolveArtifacts(unpackedComponent, result);
    if (!result.hasResult()) {
        sourceRepository.getRemoteAccess().resolveArtifacts(unpackedComponent, result);
    }
    if (result.hasResult()) {
        return result.getResult().getArtifactsFor(component, configuration, this, sourceRepository.getArtifactCache(), artifactTypeRegistry, exclusions);
    }
    return null;
}
Also used : DefaultBuildableComponentArtifactsResolveResult(org.gradle.internal.resolve.result.DefaultBuildableComponentArtifactsResolveResult) ComponentResolveMetadata(org.gradle.internal.component.model.ComponentResolveMetadata) Nullable(javax.annotation.Nullable)

Example 2 with DefaultBuildableComponentArtifactsResolveResult

use of org.gradle.internal.resolve.result.DefaultBuildableComponentArtifactsResolveResult in project gradle by gradle.

the class ResolvedArtifactsGraphVisitor method doResolve.

private Set<? extends VariantMetadata> doResolve(ComponentResolveMetadata component, ConfigurationMetadata configuration) {
    BuildableComponentArtifactsResolveResult result = new DefaultBuildableComponentArtifactsResolveResult();
    artifactResolver.resolveArtifacts(component, result);
    return result.getResult().getVariantsFor(configuration);
}
Also used : BuildableComponentArtifactsResolveResult(org.gradle.internal.resolve.result.BuildableComponentArtifactsResolveResult) DefaultBuildableComponentArtifactsResolveResult(org.gradle.internal.resolve.result.DefaultBuildableComponentArtifactsResolveResult) DefaultBuildableComponentArtifactsResolveResult(org.gradle.internal.resolve.result.DefaultBuildableComponentArtifactsResolveResult)

Aggregations

DefaultBuildableComponentArtifactsResolveResult (org.gradle.internal.resolve.result.DefaultBuildableComponentArtifactsResolveResult)2 Nullable (javax.annotation.Nullable)1 ComponentResolveMetadata (org.gradle.internal.component.model.ComponentResolveMetadata)1 BuildableComponentArtifactsResolveResult (org.gradle.internal.resolve.result.BuildableComponentArtifactsResolveResult)1