Search in sources :

Example 1 with MutableIvyModuleResolveMetadata

use of org.gradle.internal.component.external.model.MutableIvyModuleResolveMetadata in project gradle by gradle.

the class IvyResolver method parseMetaDataFromResource.

protected MutableIvyModuleResolveMetadata parseMetaDataFromResource(ModuleComponentIdentifier moduleComponentIdentifier, LocallyAvailableExternalResource cachedResource, DescriptorParseContext context) {
    MutableIvyModuleResolveMetadata metaData = metaDataParser.parseMetaData(context, cachedResource);
    checkMetadataConsistency(moduleComponentIdentifier, metaData);
    return metaData;
}
Also used : DefaultMutableIvyModuleResolveMetadata(org.gradle.internal.component.external.model.DefaultMutableIvyModuleResolveMetadata) MutableIvyModuleResolveMetadata(org.gradle.internal.component.external.model.MutableIvyModuleResolveMetadata)

Example 2 with MutableIvyModuleResolveMetadata

use of org.gradle.internal.component.external.model.MutableIvyModuleResolveMetadata in project gradle by gradle.

the class DefaultIvyDescriptorMetadataSource method parseMetaDataFromResource.

protected MutableIvyModuleResolveMetadata parseMetaDataFromResource(ModuleComponentIdentifier moduleComponentIdentifier, LocallyAvailableExternalResource cachedResource, ExternalResourceArtifactResolver artifactResolver, DescriptorParseContext context, String repoName) {
    MutableIvyModuleResolveMetadata metaData = metaDataParser.parseMetaData(context, cachedResource);
    checkMetadataConsistency(moduleComponentIdentifier, metaData);
    return metaData;
}
Also used : MutableIvyModuleResolveMetadata(org.gradle.internal.component.external.model.MutableIvyModuleResolveMetadata)

Example 3 with MutableIvyModuleResolveMetadata

use of org.gradle.internal.component.external.model.MutableIvyModuleResolveMetadata in project gradle by gradle.

the class IvyModuleResolveMetaDataBuilder method build.

public MutableIvyModuleResolveMetadata build() {
    ModuleRevisionId moduleRevisionId = ivyDescriptor.getModuleRevisionId();
    ModuleComponentIdentifier cid = DefaultModuleComponentIdentifier.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.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.MutableIvyModuleResolveMetadata)

Example 4 with MutableIvyModuleResolveMetadata

use of org.gradle.internal.component.external.model.MutableIvyModuleResolveMetadata in project gradle by gradle.

the class IvyMutableModuleMetadataFactory method missing.

@Override
public MutableIvyModuleResolveMetadata missing(ModuleComponentIdentifier from) {
    MutableIvyModuleResolveMetadata metadata = create(from);
    metadata.setMissing(true);
    return metadata;
}
Also used : DefaultMutableIvyModuleResolveMetadata(org.gradle.internal.component.external.model.DefaultMutableIvyModuleResolveMetadata) MutableIvyModuleResolveMetadata(org.gradle.internal.component.external.model.MutableIvyModuleResolveMetadata)

Example 5 with MutableIvyModuleResolveMetadata

use of org.gradle.internal.component.external.model.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.MutableIvyModuleResolveMetadata)

Aggregations

MutableIvyModuleResolveMetadata (org.gradle.internal.component.external.model.MutableIvyModuleResolveMetadata)5 DefaultMutableIvyModuleResolveMetadata (org.gradle.internal.component.external.model.DefaultMutableIvyModuleResolveMetadata)2 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 Configuration (org.gradle.internal.component.external.descriptor.Configuration)1 DefaultModuleComponentIdentifier (org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier)1 IvyDependencyDescriptor (org.gradle.internal.component.external.model.IvyDependencyDescriptor)1 Exclude (org.gradle.internal.component.model.Exclude)1