Search in sources :

Example 1 with MutableIvyModuleResolveMetadata

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;
}
Also used : IvyDependencyDescriptor(org.gradle.internal.component.external.model.ivy.IvyDependencyDescriptor) Exclude(org.gradle.internal.component.model.Exclude) Configuration(org.gradle.internal.component.external.descriptor.Configuration) ModuleComponentIdentifier(org.gradle.api.artifacts.component.ModuleComponentIdentifier) DefaultModuleComponentIdentifier(org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier) ModuleRevisionId(org.apache.ivy.core.module.id.ModuleRevisionId) NamespaceId(org.gradle.api.internal.artifacts.ivyservice.NamespaceId) MutableIvyModuleResolveMetadata(org.gradle.internal.component.external.model.ivy.MutableIvyModuleResolveMetadata)

Example 2 with MutableIvyModuleResolveMetadata

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;
}
Also used : MetaDataParser(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.MetaDataParser) ModuleDescriptorHashModuleSource(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ModuleDescriptorHashModuleSource) MutableIvyModuleResolveMetadata(org.gradle.internal.component.external.model.ivy.MutableIvyModuleResolveMetadata)

Example 3 with MutableIvyModuleResolveMetadata

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

Example 4 with MutableIvyModuleResolveMetadata

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;
}
Also used : MutableIvyModuleResolveMetadata(org.gradle.internal.component.external.model.ivy.MutableIvyModuleResolveMetadata) DefaultMutableIvyModuleResolveMetadata(org.gradle.internal.component.external.model.ivy.DefaultMutableIvyModuleResolveMetadata)

Aggregations

MutableIvyModuleResolveMetadata (org.gradle.internal.component.external.model.ivy.MutableIvyModuleResolveMetadata)4 ModuleRevisionId (org.apache.ivy.core.module.id.ModuleRevisionId)1 ModuleVersionIdentifier (org.gradle.api.artifacts.ModuleVersionIdentifier)1 ModuleComponentIdentifier (org.gradle.api.artifacts.component.ModuleComponentIdentifier)1 NamespaceId (org.gradle.api.internal.artifacts.ivyservice.NamespaceId)1 ModuleDescriptorHashModuleSource (org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ModuleDescriptorHashModuleSource)1 MetaDataParser (org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.MetaDataParser)1 Configuration (org.gradle.internal.component.external.descriptor.Configuration)1 DefaultModuleComponentIdentifier (org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier)1 DefaultMutableIvyModuleResolveMetadata (org.gradle.internal.component.external.model.ivy.DefaultMutableIvyModuleResolveMetadata)1 IvyDependencyDescriptor (org.gradle.internal.component.external.model.ivy.IvyDependencyDescriptor)1 Exclude (org.gradle.internal.component.model.Exclude)1