This commit is contained in:
Alexandre Archambault 2016-04-28 23:17:07 +02:00
parent bf919d4fc1
commit 869d57c2f4
No known key found for this signature in database
GPG Key ID: 14640A6839C263A9
1 changed files with 20 additions and 18 deletions

View File

@ -6,27 +6,26 @@ object MakeIvyXml {
def apply(project: Project): Node = {
val baseInfoAttrs = <x
organisation={project.module.organization}
module={project.module.name}
revision={project.version}
/>.attributes
val infoAttrs = project.module.attributes.foldLeft(baseInfoAttrs) {
val infoAttrs = project.module.attributes.foldLeft[xml.MetaData](xml.Null) {
case (acc, (k, v)) =>
new PrefixedAttribute("e", k, v, acc)
}
val licenseElems = project.info.licenses.map {
case (name, urlOpt) =>
var n = <license name={name} />
for (url <- urlOpt)
n = n % <x url={url} />.attributes
n
val n = <license name={name} />
urlOpt.fold(n) { url =>
n % <x url={url} />.attributes
}
}
val infoElem = {
<info>
<info
organisation={project.module.organization}
module={project.module.name}
revision={project.version}
>
{licenseElems}
<description>{project.info.description}</description>
</info>
@ -34,10 +33,11 @@ object MakeIvyXml {
val confElems = project.configurations.toVector.map {
case (name, extends0) =>
var n = <conf name={name} visibility="public" description="" />
val n = <conf name={name} visibility="public" description="" />
if (extends0.nonEmpty)
n = n % <x extends={extends0.mkString(",")} />.attributes
n
n % <x extends={extends0.mkString(",")} />.attributes
else
n
}
val publications = project
@ -47,10 +47,12 @@ object MakeIvyXml {
val publicationElems = publications.map {
case (pub, configs) =>
var n = <artifact name={pub.name} type={pub.`type`} ext={pub.ext} conf={configs.mkString(",")} />
val n = <artifact name={pub.name} type={pub.`type`} ext={pub.ext} conf={configs.mkString(",")} />
if (pub.classifier.nonEmpty)
n = n % <x e:classifier={pub.classifier} />.attributes
n
n % <x e:classifier={pub.classifier} />.attributes
else
n
}
val dependencyElems = project.dependencies.toVector.map {