Search in sources :

Example 6 with DefaultModuleComponentArtifactMetadata

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

the class DefaultGradleModuleMetadataSource method create.

@Override
public MutableModuleComponentResolveMetadata create(String repositoryName, ComponentResolvers componentResolvers, ModuleComponentIdentifier moduleComponentIdentifier, ComponentOverrideMetadata prescribedMetaData, ExternalResourceArtifactResolver artifactResolver, BuildableModuleComponentMetaDataResolveResult result) {
    DefaultIvyArtifactName moduleMetadataArtifact = new DefaultIvyArtifactName(moduleComponentIdentifier.getModule(), "module", "module");
    DefaultModuleComponentArtifactMetadata artifactId = new DefaultModuleComponentArtifactMetadata(moduleComponentIdentifier, moduleMetadataArtifact);
    LocallyAvailableExternalResource gradleMetadataArtifact = artifactResolver.resolveArtifact(artifactId, result);
    if (gradleMetadataArtifact != null) {
        MutableModuleComponentResolveMetadata metaDataFromResource = mutableModuleMetadataFactory.createForGradleModuleMetadata(moduleComponentIdentifier);
        metadataParser.parse(gradleMetadataArtifact, metaDataFromResource);
        validateGradleMetadata(metaDataFromResource);
        createModuleSources(artifactId, gradleMetadataArtifact, metaDataFromResource);
        metadataCompatibilityConverter.process(metaDataFromResource);
        return metaDataFromResource;
    }
    return null;
}
Also used : DefaultIvyArtifactName(org.gradle.internal.component.model.DefaultIvyArtifactName) MutableModuleComponentResolveMetadata(org.gradle.internal.component.external.model.MutableModuleComponentResolveMetadata) DefaultModuleComponentArtifactMetadata(org.gradle.internal.component.external.model.DefaultModuleComponentArtifactMetadata) LocallyAvailableExternalResource(org.gradle.internal.resource.local.LocallyAvailableExternalResource)

Aggregations

DefaultModuleComponentArtifactMetadata (org.gradle.internal.component.external.model.DefaultModuleComponentArtifactMetadata)6 DefaultIvyArtifactName (org.gradle.internal.component.model.DefaultIvyArtifactName)4 ModuleComponentIdentifier (org.gradle.api.artifacts.component.ModuleComponentIdentifier)2 ModuleComponentArtifactMetadata (org.gradle.internal.component.external.model.ModuleComponentArtifactMetadata)2 DefaultIvyArtifactRepository (org.gradle.api.internal.artifacts.repositories.DefaultIvyArtifactRepository)1 IvyResolver (org.gradle.api.internal.artifacts.repositories.resolver.IvyResolver)1 IvyArtifact (org.gradle.api.publish.ivy.IvyArtifact)1 Artifact (org.gradle.internal.component.external.descriptor.Artifact)1 DefaultModuleComponentIdentifier (org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier)1 MutableModuleComponentResolveMetadata (org.gradle.internal.component.external.model.MutableModuleComponentResolveMetadata)1 DefaultModuleDescriptorArtifactMetadata (org.gradle.internal.component.model.DefaultModuleDescriptorArtifactMetadata)1 IvyArtifactName (org.gradle.internal.component.model.IvyArtifactName)1 LocallyAvailableExternalResource (org.gradle.internal.resource.local.LocallyAvailableExternalResource)1