use of org.gradle.internal.component.model.MutableModuleSources 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.internal.component.model.MutableModuleSources in project gradle by gradle.
the class ModuleSourcesSerializer method read.
@Override
public ModuleSources read(Decoder decoder) throws IOException {
MutableModuleSources sources = new MutableModuleSources();
int codecId;
while ((codecId = decoder.readSmallInt()) > 0) {
sources.add(moduleSourceCodecs.get(codecId).decode(decoder));
}
return sources;
}
use of org.gradle.internal.component.model.MutableModuleSources in project gradle by gradle.
the class AbstractRepositoryMetadataSource method parseMetaDataFromArtifact.
@Nullable
private S parseMetaDataFromArtifact(String repositoryName, ComponentResolvers componentResolvers, ModuleComponentIdentifier moduleComponentIdentifier, ExternalResourceArtifactResolver artifactResolver, ResourceAwareResolveResult result) {
ModuleComponentArtifactMetadata artifact = getMetaDataArtifactFor(moduleComponentIdentifier);
LocallyAvailableExternalResource metadataArtifact = artifactResolver.resolveArtifact(artifact, result);
if (metadataArtifact != null) {
ExternalResourceResolverDescriptorParseContext context = new ExternalResourceResolverDescriptorParseContext(componentResolvers, fileResourceRepository, checksumService);
MetaDataParser.ParseResult<S> parseResult = parseMetaDataFromResource(moduleComponentIdentifier, metadataArtifact, artifactResolver, context, repositoryName);
if (parseResult != null) {
if (parseResult.hasGradleMetadataRedirectionMarker()) {
if (result instanceof BuildableModuleComponentMetaDataResolveResult) {
((BuildableModuleComponentMetaDataResolveResult) result).redirectToGradleMetadata();
} else {
throw new IllegalStateException("Unexpected Gradle metadata redirection answer");
}
}
S metadata = parseResult.getResult();
File metadataArtifactFile = metadataArtifact.getFile();
ExternalResourceMetaData metaData = metadataArtifact.getMetaData();
MutableModuleSources sources = metadata.getSources();
sources.add(new DefaultMetadataFileSource(artifact.getId(), metadataArtifactFile, findSha1(metaData, metadataArtifactFile)));
context.appendSources(sources);
return metadata;
}
}
return null;
}
Aggregations