Search in sources :

Example 1 with ModuleComponentArtifactIdentifier

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());
}
Also used : ModuleComponentArtifactIdentifier(org.gradle.internal.component.external.model.ModuleComponentArtifactIdentifier) ModuleComponentIdentifier(org.gradle.api.artifacts.component.ModuleComponentIdentifier) DefaultModuleComponentIdentifier(org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier)

Example 2 with ModuleComponentArtifactIdentifier

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);
}
Also used : ModuleComponentArtifactIdentifier(org.gradle.internal.component.external.model.ModuleComponentArtifactIdentifier) HashCode(org.gradle.internal.hash.HashCode) File(java.io.File)

Example 3 with ModuleComponentArtifactIdentifier

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);
}
Also used : ModuleComponentArtifactIdentifier(org.gradle.internal.component.external.model.ModuleComponentArtifactIdentifier) RepositoryAwareVerificationFailure(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.RepositoryAwareVerificationFailure)

Example 4 with ModuleComponentArtifactIdentifier

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;
}
Also used : ComponentArtifactIdentifier(org.gradle.api.artifacts.component.ComponentArtifactIdentifier) ModuleComponentArtifactIdentifier(org.gradle.internal.component.external.model.ModuleComponentArtifactIdentifier) ModuleComponentArtifactIdentifier(org.gradle.internal.component.external.model.ModuleComponentArtifactIdentifier) DefaultBuildableComponentResolveResult(org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult) BuildableComponentResolveResult(org.gradle.internal.resolve.result.BuildableComponentResolveResult) ComponentArtifactMetadata(org.gradle.internal.component.model.ComponentArtifactMetadata) DefaultMetadataFileSource(org.gradle.api.internal.artifacts.repositories.metadata.DefaultMetadataFileSource) DefaultBuildableComponentResolveResult(org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult) LocallyAvailableExternalResource(org.gradle.internal.resource.local.LocallyAvailableExternalResource) BuildableArtifactSetResolveResult(org.gradle.internal.resolve.result.BuildableArtifactSetResolveResult) DefaultBuildableArtifactSetResolveResult(org.gradle.internal.resolve.result.DefaultBuildableArtifactSetResolveResult) DefaultBuildableArtifactSetResolveResult(org.gradle.internal.resolve.result.DefaultBuildableArtifactSetResolveResult) BuildableArtifactResolveResult(org.gradle.internal.resolve.result.BuildableArtifactResolveResult) DefaultBuildableArtifactResolveResult(org.gradle.internal.resolve.result.DefaultBuildableArtifactResolveResult) DefaultBuildableArtifactResolveResult(org.gradle.internal.resolve.result.DefaultBuildableArtifactResolveResult) File(java.io.File)

Aggregations

ModuleComponentArtifactIdentifier (org.gradle.internal.component.external.model.ModuleComponentArtifactIdentifier)4 File (java.io.File)2 ComponentArtifactIdentifier (org.gradle.api.artifacts.component.ComponentArtifactIdentifier)1 ModuleComponentIdentifier (org.gradle.api.artifacts.component.ModuleComponentIdentifier)1 RepositoryAwareVerificationFailure (org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.RepositoryAwareVerificationFailure)1 DefaultMetadataFileSource (org.gradle.api.internal.artifacts.repositories.metadata.DefaultMetadataFileSource)1 DefaultModuleComponentIdentifier (org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier)1 ComponentArtifactMetadata (org.gradle.internal.component.model.ComponentArtifactMetadata)1 HashCode (org.gradle.internal.hash.HashCode)1 BuildableArtifactResolveResult (org.gradle.internal.resolve.result.BuildableArtifactResolveResult)1 BuildableArtifactSetResolveResult (org.gradle.internal.resolve.result.BuildableArtifactSetResolveResult)1 BuildableComponentResolveResult (org.gradle.internal.resolve.result.BuildableComponentResolveResult)1 DefaultBuildableArtifactResolveResult (org.gradle.internal.resolve.result.DefaultBuildableArtifactResolveResult)1 DefaultBuildableArtifactSetResolveResult (org.gradle.internal.resolve.result.DefaultBuildableArtifactSetResolveResult)1 DefaultBuildableComponentResolveResult (org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult)1 LocallyAvailableExternalResource (org.gradle.internal.resource.local.LocallyAvailableExternalResource)1