use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ModuleDescriptorHashModuleSource in project gradle by gradle.
the class DefaultGradleModuleMetadataSource method createModuleSources.
private void createModuleSources(DefaultModuleComponentArtifactMetadata artifactId, LocallyAvailableExternalResource gradleMetadataArtifact, MutableModuleComponentResolveMetadata metaDataFromResource) {
MutableModuleSources sources = metaDataFromResource.getSources();
File file = gradleMetadataArtifact.getFile();
sources.add(new ModuleDescriptorHashModuleSource(checksumService.md5(file), metaDataFromResource.isChanging()));
sources.add(new DefaultMetadataFileSource(artifactId.getId(), file, findSha1(gradleMetadataArtifact.getMetaData(), file)));
}
use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ModuleDescriptorHashModuleSource in project gradle by gradle.
the class DefaultIvyDescriptorMetadataSource method parseMetaDataFromResource.
@Override
protected MetaDataParser.ParseResult<MutableIvyModuleResolveMetadata> parseMetaDataFromResource(ModuleComponentIdentifier moduleComponentIdentifier, LocallyAvailableExternalResource cachedResource, ExternalResourceArtifactResolver artifactResolver, DescriptorParseContext context, String repoName) {
MetaDataParser.ParseResult<MutableIvyModuleResolveMetadata> parseResult = metaDataParser.parseMetaData(context, cachedResource);
MutableIvyModuleResolveMetadata metaData = parseResult.getResult();
if (metaData != null) {
metaData.getSources().add(new ModuleDescriptorHashModuleSource(checksumService.md5(cachedResource.getFile()), metaData.isChanging()));
checkMetadataConsistency(moduleComponentIdentifier, metaData);
}
return parseResult;
}
use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ModuleDescriptorHashModuleSource in project gradle by gradle.
the class DefaultArtifactMetadataSource method create.
@Override
public MutableModuleComponentResolveMetadata create(String repositoryName, ComponentResolvers componentResolvers, ModuleComponentIdentifier moduleComponentIdentifier, ComponentOverrideMetadata prescribedMetaData, ExternalResourceArtifactResolver artifactResolver, BuildableModuleComponentMetaDataResolveResult result) {
MutableModuleComponentResolveMetadata metaDataFromDefaultArtifact = createMetaDataFromDependencyArtifact(moduleComponentIdentifier, prescribedMetaData, artifactResolver, result);
if (metaDataFromDefaultArtifact != null) {
LOGGER.debug("Found artifact but no meta-data for module '{}' in repository '{}', using default meta-data.", moduleComponentIdentifier, repositoryName);
metaDataFromDefaultArtifact.getSources().add(new ModuleDescriptorHashModuleSource(getDescriptorHash(moduleComponentIdentifier), false));
return metaDataFromDefaultArtifact;
}
return null;
}
use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ModuleDescriptorHashModuleSource in project gradle by gradle.
the class DefaultMavenPomMetadataSource method parseMetaDataFromResource.
@Override
protected MetaDataParser.ParseResult<MutableMavenModuleResolveMetadata> parseMetaDataFromResource(ModuleComponentIdentifier moduleComponentIdentifier, LocallyAvailableExternalResource cachedResource, ExternalResourceArtifactResolver artifactResolver, DescriptorParseContext context, String repoName) {
MetaDataParser.ParseResult<MutableMavenModuleResolveMetadata> parseResult = pomParser.parseMetaData(context, cachedResource);
MutableMavenModuleResolveMetadata metaData = parseResult.getResult();
if (metaData != null) {
if (moduleComponentIdentifier instanceof MavenUniqueSnapshotComponentIdentifier) {
// Snapshot POMs use -SNAPSHOT instead of the timestamp as version, so validate against the expected id
MavenUniqueSnapshotComponentIdentifier snapshotComponentIdentifier = (MavenUniqueSnapshotComponentIdentifier) moduleComponentIdentifier;
checkMetadataConsistency(snapshotComponentIdentifier.getSnapshotComponent(), metaData);
metaData.setId(snapshotComponentIdentifier);
metaData.setSnapshotTimestamp(snapshotComponentIdentifier.getTimestamp());
} else {
checkMetadataConsistency(moduleComponentIdentifier, metaData);
}
MutableMavenModuleResolveMetadata result = MavenResolver.processMetaData(metaData);
result.getSources().add(new ModuleDescriptorHashModuleSource(checksumService.md5(cachedResource.getFile()), metaData.isChanging()));
if (validator.isUsableModule(repoName, result, artifactResolver)) {
return parseResult;
}
return null;
}
return parseResult;
}
Aggregations