Permalink
Browse files

Declare extra namespace in ModuleDescriptor for parsed plugin poms. F…

…ixes #368.
  • Loading branch information...
harrah committed Feb 27, 2012
1 parent 185b200 commit 8a0cc329f57a140cf81c678acd2ff65db25c157d
Showing with 6 additions and 2 deletions.
  1. +2 −1 ivy/CustomPomParser.scala
  2. +4 −1 ivy/Ivy.scala
@@ -64,7 +64,7 @@ object CustomPomParser
// Fixes up the detected extension in some cases missed by Ivy.
val convertArtifacts = artifactExtIncorrect(md)
- val unqualify = filtered - ExtraAttributesKey
+ val unqualify = (filtered - ExtraAttributesKey) map { case (k,v) => ("e:" + k, v) }
if(unqualify.isEmpty && extraDepAttributes.isEmpty && !convertArtifacts)
md
else
@@ -168,6 +168,7 @@ object CustomPomParser
for(l <- md.getLicenses) dmd.addLicense(l)
for( (key,value) <- md.getExtraInfo.asInstanceOf[java.util.Map[String,String]].asScala ) dmd.addExtraInfo(key, value)
for( (key, value) <- md.getExtraAttributesNamespaces.asInstanceOf[java.util.Map[String,String]].asScala ) dmd.addExtraAttributeNamespace(key, value)
+ IvySbt.addExtraNamespace(dmd)
for( dd <- md.getDependencies ) dmd.addDependency(addExtra(dd, dependencyExtra))
for( ed <- md.getInheritedDescriptors) dmd.addInheritedDescriptor( new DefaultExtendsDescriptor( mrid, resolvedMrid, ed.getLocation, ed.getExtendsTypes) )
View
@@ -129,7 +129,7 @@ final class IvySbt(val configuration: IvyConfiguration)
case ifc: IvyFileConfiguration => configureIvyFile(ifc)
}
moduleSettings.ivyScala.foreach(IvyScala.checkModule(baseModule, baseConfiguration))
- baseModule.getExtraAttributesNamespaces.asInstanceOf[java.util.Map[String,String]].put("e", "http://ant.apache.org/ivy/extra")
+ IvySbt.addExtraNamespace(baseModule)
(baseModule, baseConfiguration)
}
private def configureInline(ic: InlineConfiguration, log: Logger) =
@@ -284,6 +284,9 @@ private object IvySbt
import configuration._
new IvyConfig(name, if(isPublic) PUBLIC else PRIVATE, description, extendsConfigs.map(_.name).toArray, transitive, null)
}
+ def addExtraNamespace(dmd: DefaultModuleDescriptor): Unit =
+ dmd.addExtraAttributeNamespace("e", "http://ant.apache.org/ivy/extra")
+
/** Adds the ivy.xml main artifact. */
private def addMainArtifact(moduleID: DefaultModuleDescriptor)
{

0 comments on commit 8a0cc32

Please sign in to comment.