use of org.gradle.internal.component.external.model.ModuleComponentArtifactIdentifier in project gradle by gradle.
the class DefaultMetadataFileSourceCodec method encode.
@Override
public void encode(MetadataFileSource moduleSource, Encoder encoder) throws IOException {
ModuleComponentArtifactIdentifier artifactId = moduleSource.getArtifactId();
ModuleComponentIdentifier componentIdentifier = artifactId.getComponentIdentifier();
encoder.writeString(componentIdentifier.getGroup());
encoder.writeString(componentIdentifier.getModule());
encoder.writeString(componentIdentifier.getVersion());
encoder.writeString(artifactId.getFileName());
encoder.writeBinary(moduleSource.getSha1().toByteArray());
}
use of org.gradle.internal.component.external.model.ModuleComponentArtifactIdentifier in project gradle by gradle.
the class DefaultMetadataFileSourceCodec method createSource.
private DefaultMetadataFileSource createSource(byte[] sha1, String group, String module, String version, String name) {
ModuleComponentArtifactIdentifier artifactId = createArtifactId(group, module, version, name);
HashCode hashCode = HashCode.fromBytes(sha1);
File metadataFile = fileStore.whereIs(artifactId, hashCode.toString());
return new DefaultMetadataFileSource(artifactId, metadataFile, hashCode);
}
use of org.gradle.internal.component.external.model.ModuleComponentArtifactIdentifier in project gradle by gradle.
the class DependencyVerificationReportWriter method doRender.
public void doRender(String displayName, Multimap<ModuleComponentArtifactIdentifier, RepositoryAwareVerificationFailure> failuresByArtifact, DependencyVerificationReportRenderer renderer, boolean useKeyServers) {
ReportState reportState = new ReportState();
if (!useKeyServers) {
reportState.keyServersAreDisabled();
}
renderer.startNewSection(displayName);
renderer.startArtifactErrors(() -> {
// Sorting entries so that error messages are always displayed in a reproducible order
failuresByArtifact.asMap().entrySet().stream().sorted(DELETED_LAST.thenComparing(MISSING_LAST).thenComparing(BY_MODULE_ID)).forEachOrdered(entry -> {
ModuleComponentArtifactIdentifier key = entry.getKey();
Collection<RepositoryAwareVerificationFailure> failures = entry.getValue();
onArtifactFailure(renderer, reportState, key, failures);
});
});
renderer.finish(reportState);
}
use of org.gradle.internal.component.external.model.ModuleComponentArtifactIdentifier 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