use of org.gradle.internal.resolve.result.BuildableComponentResolveResult in project gradle by gradle.
the class DefaultArtifactResolutionQuery method buildComponentResult.
private ComponentArtifactsResult buildComponentResult(ComponentIdentifier componentId, ComponentMetaDataResolver componentMetaDataResolver, ArtifactResolver artifactResolver) {
BuildableComponentResolveResult moduleResolveResult = new DefaultBuildableComponentResolveResult();
componentMetaDataResolver.resolve(componentId, DefaultComponentOverrideMetadata.EMPTY, moduleResolveResult);
ComponentResolveMetadata component = moduleResolveResult.getMetadata();
DefaultComponentArtifactsResult componentResult = new DefaultComponentArtifactsResult(component.getId());
for (Class<? extends Artifact> artifactType : artifactTypes) {
addArtifacts(componentResult, artifactType, component, artifactResolver);
}
return componentResult;
}
use of org.gradle.internal.resolve.result.BuildableComponentResolveResult in project gradle by gradle.
the class ExternalResourceResolverDescriptorParseContext method resolveMetaDataArtifactFile.
private LocallyAvailableExternalResource resolveMetaDataArtifactFile(ModuleComponentIdentifier moduleComponentIdentifier, ComponentMetaDataResolver componentResolver, ArtifactResolver artifactResolver, ArtifactType artifactType) {
BuildableComponentResolveResult moduleVersionResolveResult = new DefaultBuildableComponentResolveResult();
componentResolver.resolve(moduleComponentIdentifier, DefaultComponentOverrideMetadata.EMPTY, moduleVersionResolveResult);
BuildableArtifactSetResolveResult moduleArtifactsResolveResult = new DefaultBuildableArtifactSetResolveResult();
artifactResolver.resolveArtifactsWithType(moduleVersionResolveResult.getMetadata(), artifactType, moduleArtifactsResolveResult);
BuildableArtifactResolveResult artifactResolveResult = new DefaultBuildableArtifactResolveResult();
ComponentArtifactMetadata artifactMetaData = moduleArtifactsResolveResult.getResult().iterator().next();
artifactResolver.resolveArtifact(artifactMetaData, moduleVersionResolveResult.getMetadata().getSources(), artifactResolveResult);
File file = artifactResolveResult.getResult();
LocallyAvailableExternalResource resource = fileResourceRepository.resource(file);
ComponentArtifactIdentifier id = artifactMetaData.getId();
if (id instanceof ModuleComponentArtifactIdentifier) {
sources.add(new DefaultMetadataFileSource((ModuleComponentArtifactIdentifier) id, file, checksumService.sha1(file)));
}
return resource;
}
Aggregations