mirror of https://github.com/sbt/sbt.git
Tidying
This commit is contained in:
parent
bf919d4fc1
commit
869d57c2f4
|
|
@ -6,27 +6,26 @@ object MakeIvyXml {
|
||||||
|
|
||||||
def apply(project: Project): Node = {
|
def apply(project: Project): Node = {
|
||||||
|
|
||||||
val baseInfoAttrs = <x
|
val infoAttrs = project.module.attributes.foldLeft[xml.MetaData](xml.Null) {
|
||||||
organisation={project.module.organization}
|
|
||||||
module={project.module.name}
|
|
||||||
revision={project.version}
|
|
||||||
/>.attributes
|
|
||||||
|
|
||||||
val infoAttrs = project.module.attributes.foldLeft(baseInfoAttrs) {
|
|
||||||
case (acc, (k, v)) =>
|
case (acc, (k, v)) =>
|
||||||
new PrefixedAttribute("e", k, v, acc)
|
new PrefixedAttribute("e", k, v, acc)
|
||||||
}
|
}
|
||||||
|
|
||||||
val licenseElems = project.info.licenses.map {
|
val licenseElems = project.info.licenses.map {
|
||||||
case (name, urlOpt) =>
|
case (name, urlOpt) =>
|
||||||
var n = <license name={name} />
|
val n = <license name={name} />
|
||||||
for (url <- urlOpt)
|
|
||||||
n = n % <x url={url} />.attributes
|
urlOpt.fold(n) { url =>
|
||||||
n
|
n % <x url={url} />.attributes
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val infoElem = {
|
val infoElem = {
|
||||||
<info>
|
<info
|
||||||
|
organisation={project.module.organization}
|
||||||
|
module={project.module.name}
|
||||||
|
revision={project.version}
|
||||||
|
>
|
||||||
{licenseElems}
|
{licenseElems}
|
||||||
<description>{project.info.description}</description>
|
<description>{project.info.description}</description>
|
||||||
</info>
|
</info>
|
||||||
|
|
@ -34,9 +33,10 @@ object MakeIvyXml {
|
||||||
|
|
||||||
val confElems = project.configurations.toVector.map {
|
val confElems = project.configurations.toVector.map {
|
||||||
case (name, extends0) =>
|
case (name, extends0) =>
|
||||||
var n = <conf name={name} visibility="public" description="" />
|
val n = <conf name={name} visibility="public" description="" />
|
||||||
if (extends0.nonEmpty)
|
if (extends0.nonEmpty)
|
||||||
n = n % <x extends={extends0.mkString(",")} />.attributes
|
n % <x extends={extends0.mkString(",")} />.attributes
|
||||||
|
else
|
||||||
n
|
n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -47,9 +47,11 @@ object MakeIvyXml {
|
||||||
|
|
||||||
val publicationElems = publications.map {
|
val publicationElems = publications.map {
|
||||||
case (pub, configs) =>
|
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)
|
if (pub.classifier.nonEmpty)
|
||||||
n = n % <x e:classifier={pub.classifier} />.attributes
|
n % <x e:classifier={pub.classifier} />.attributes
|
||||||
|
else
|
||||||
n
|
n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue