Only write 'info' tag if user has not provided one.

This commit is contained in:
Mark Harrah 2009-10-11 15:43:42 -04:00
parent 1d40e5e71d
commit 1a74b7e863
1 changed files with 9 additions and 4 deletions

View File

@ -245,15 +245,20 @@ private object IvySbt
map
}
}
/** Creates a full ivy file for 'module' using the 'content' XML as the part after the <info>...</info> section. */
private def wrapped(module: ModuleID, content: scala.xml.NodeSeq) =
/** Creates a full ivy file for 'module' using the 'dependencies' XML as the part after the <info>...</info> section. */
private def wrapped(module: ModuleID, dependencies: scala.xml.NodeSeq) =
{
import module._
<ivy-module version="2.0">
{ if(hasInfo(dependencies))
scala.xml.NodeSeq.Empty
else
<info organisation={organization} module={name} revision={revision}/>
{content}
}
{dependencies}
</ivy-module>
}
private def hasInfo(x: scala.xml.NodeSeq) = !(<g>{x}</g> \ "info").isEmpty
/** Parses the given in-memory Ivy file 'xml', using the existing 'moduleID' and specifying the given 'defaultConfiguration'. */
private def parseIvyXML(settings: IvySettings, xml: scala.xml.NodeSeq, moduleID: DefaultModuleDescriptor, defaultConfiguration: String, validate: Boolean): CustomXmlParser.CustomParser =
parseIvyXML(settings, xml.toString, moduleID, defaultConfiguration, validate)