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 = {
|
||||
|
||||
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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue