Search in sources :

Example 1 with ModuleDescriptorState

use of org.gradle.internal.component.external.descriptor.ModuleDescriptorState in project gradle by gradle.

the class IvyModuleResolveMetaDataBuilder method build.

public DefaultMutableIvyModuleResolveMetadata build() {
    ModuleDescriptorState descriptorState = converter.forIvyModuleDescriptor(ivyDescriptor);
    for (Artifact artifact : artifacts) {
        descriptorState.addArtifact(artifact.getArtifactName(), artifact.getConfigurations());
    }
    List<Configuration> configurations = converter.extractConfigurations(ivyDescriptor);
    List<IvyDependencyMetadata> dependencies = converter.extractDependencies(ivyDescriptor);
    ModuleComponentIdentifier cid = descriptorState.getComponentIdentifier();
    ModuleVersionIdentifier mvi = moduleIdentifierFactory.moduleWithVersion(cid.getGroup(), cid.getModule(), cid.getVersion());
    return new DefaultMutableIvyModuleResolveMetadata(mvi, cid, descriptorState, configurations, dependencies);
}
Also used : ModuleVersionIdentifier(org.gradle.api.artifacts.ModuleVersionIdentifier) Configuration(org.gradle.internal.component.external.descriptor.Configuration) IvyDependencyMetadata(org.gradle.internal.component.external.model.IvyDependencyMetadata) ModuleComponentIdentifier(org.gradle.api.artifacts.component.ModuleComponentIdentifier) ModuleDescriptorState(org.gradle.internal.component.external.descriptor.ModuleDescriptorState) DefaultMutableIvyModuleResolveMetadata(org.gradle.internal.component.external.model.DefaultMutableIvyModuleResolveMetadata) Artifact(org.gradle.internal.component.external.descriptor.Artifact)

Example 2 with ModuleDescriptorState

use of org.gradle.internal.component.external.descriptor.ModuleDescriptorState in project gradle by gradle.

the class GradlePomModuleDescriptorParser method doParseDescriptor.

protected MutableMavenModuleResolveMetadata doParseDescriptor(DescriptorParseContext parserSettings, LocallyAvailableExternalResource resource, boolean validate) throws IOException, ParseException, SAXException {
    PomReader pomReader = new PomReader(resource, moduleIdentifierFactory);
    GradlePomModuleDescriptorBuilder mdBuilder = new GradlePomModuleDescriptorBuilder(pomReader, gradleVersionSelectorScheme, mavenVersionSelectorScheme, moduleIdentifierFactory, moduleExclusions);
    doParsePom(parserSettings, mdBuilder, pomReader);
    ModuleDescriptorState moduleDescriptor = mdBuilder.getModuleDescriptor();
    List<DependencyMetadata> dependencies = mdBuilder.getDependencies();
    ModuleComponentIdentifier cid = moduleDescriptor.getComponentIdentifier();
    ModuleVersionIdentifier id = moduleIdentifierFactory.moduleWithVersion(cid.getGroup(), cid.getModule(), cid.getVersion());
    if (pomReader.getRelocation() != null) {
        return new DefaultMutableMavenModuleResolveMetadata(id, moduleDescriptor, "pom", true, dependencies);
    }
    return new DefaultMutableMavenModuleResolveMetadata(id, moduleDescriptor, pomReader.getPackaging(), false, dependencies);
}
Also used : ModuleVersionIdentifier(org.gradle.api.artifacts.ModuleVersionIdentifier) DefaultMutableMavenModuleResolveMetadata(org.gradle.internal.component.external.model.DefaultMutableMavenModuleResolveMetadata) DefaultModuleComponentIdentifier(org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier) ModuleComponentIdentifier(org.gradle.api.artifacts.component.ModuleComponentIdentifier) DependencyMetadata(org.gradle.internal.component.model.DependencyMetadata) ModuleDescriptorState(org.gradle.internal.component.external.descriptor.ModuleDescriptorState)

Example 3 with ModuleDescriptorState

use of org.gradle.internal.component.external.descriptor.ModuleDescriptorState in project gradle by gradle.

the class IvyXmlModuleDescriptorWriter method writeTo.

private void writeTo(IvyModulePublishMetadata metadata, SimpleXmlWriter writer) throws IOException {
    writer.startElement("ivy-module");
    writer.attribute("version", "2.0");
    writer.attribute("xmlns:" + IvyModulePublishMetadata.IVY_MAVEN_NAMESPACE_PREFIX, IvyModulePublishMetadata.IVY_MAVEN_NAMESPACE);
    ModuleDescriptorState descriptor = metadata.getModuleDescriptor();
    printInfoTag(descriptor, writer);
    printConfigurations(metadata, writer);
    printPublications(metadata.getArtifacts(), writer);
    printDependencies(metadata, writer);
    writer.endElement();
}
Also used : ModuleDescriptorState(org.gradle.internal.component.external.descriptor.ModuleDescriptorState)

Aggregations

ModuleDescriptorState (org.gradle.internal.component.external.descriptor.ModuleDescriptorState)3 ModuleVersionIdentifier (org.gradle.api.artifacts.ModuleVersionIdentifier)2 ModuleComponentIdentifier (org.gradle.api.artifacts.component.ModuleComponentIdentifier)2 Artifact (org.gradle.internal.component.external.descriptor.Artifact)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.DefaultMutableIvyModuleResolveMetadata)1 DefaultMutableMavenModuleResolveMetadata (org.gradle.internal.component.external.model.DefaultMutableMavenModuleResolveMetadata)1 IvyDependencyMetadata (org.gradle.internal.component.external.model.IvyDependencyMetadata)1 DependencyMetadata (org.gradle.internal.component.model.DependencyMetadata)1