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);
}
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);
}
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();
}
Aggregations