use of org.gradle.internal.component.external.model.ivy.MutableIvyModuleResolveMetadata in project gradle by gradle.
the class IvyModuleResolveMetaDataBuilder method build.
public MutableIvyModuleResolveMetadata build() {
ModuleRevisionId moduleRevisionId = ivyDescriptor.getModuleRevisionId();
ModuleComponentIdentifier cid = DefaultModuleComponentIdentifier.newId(DefaultModuleIdentifier.newId(moduleRevisionId.getOrganisation(), moduleRevisionId.getName()), moduleRevisionId.getRevision());
List<Configuration> configurations = converter.extractConfigurations(ivyDescriptor);
List<IvyDependencyDescriptor> dependencies = converter.extractDependencies(ivyDescriptor);
List<Exclude> excludes = converter.extractExcludes(ivyDescriptor);
Map<NamespaceId, String> extraAttributes = converter.extractExtraAttributes(ivyDescriptor);
MutableIvyModuleResolveMetadata metadata = metadataFactory.create(cid, dependencies, configurations, artifacts, excludes);
metadata.setStatus(ivyDescriptor.getStatus());
metadata.setExtraAttributes(extraAttributes);
metadata.setBranch(ivyDescriptor.getModuleRevisionId().getBranch());
return metadata;
}
use of org.gradle.internal.component.external.model.ivy.MutableIvyModuleResolveMetadata 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.internal.component.external.model.ivy.MutableIvyModuleResolveMetadata in project gradle by gradle.
the class ValidatingIvyPublisher method validateMetadata.
private void validateMetadata(IvyNormalizedPublication publication) {
IvyPublicationIdentity identity = publication.getProjectIdentity();
IvyFieldValidator organisation = field(publication, "organisation", identity.getOrganisation()).notEmpty().validInFileName();
IvyFieldValidator moduleName = field(publication, "module name", identity.getModule()).notEmpty().validInFileName();
IvyFieldValidator revision = field(publication, "revision", identity.getRevision()).notEmpty().validInFileName();
MutableIvyModuleResolveMetadata metadata = parseIvyFile(publication);
ModuleVersionIdentifier moduleId = metadata.getModuleVersionId();
organisation.matches(moduleId.getGroup());
moduleName.matches(moduleId.getName());
revision.matches(moduleId.getVersion());
field(publication, "branch", metadata.getBranch()).optionalNotEmpty().doesNotContainSpecialCharacters(true);
field(publication, "status", metadata.getStatus()).optionalNotEmpty().validInFileName();
}
use of org.gradle.internal.component.external.model.ivy.MutableIvyModuleResolveMetadata in project gradle by gradle.
the class IvyMutableModuleMetadataFactory method missing.
@Override
public MutableIvyModuleResolveMetadata missing(ModuleComponentIdentifier from) {
MutableIvyModuleResolveMetadata metadata = create(from, ImmutableList.of());
metadata.setMissing(true);
return metadata;
}
Aggregations