write info.apiURL to ivy.xml

Ref https://github.com/coursier/coursier/issues/1123
This commit is contained in:
Eugene Yokota 2019-04-17 18:23:24 -04:00
parent 38f94a6e31
commit 21782a51f0
2 changed files with 13 additions and 6 deletions

View File

@ -38,16 +38,22 @@ private[sbt] object LMCoursier {
def coursierProjectTask: Def.Initialize[sbt.Task[CProject]] =
Def.task {
Inputs.coursierProject(
val auOpt = apiURL.value
val proj = Inputs.coursierProject(
projectID.value,
allDependencies.value,
excludeDependencies.value,
// should projectID.configurations be used instead?
ivyConfigurations.value,
scalaVersion.value,
scalaBinaryVersion.value,
streams.value.log
)
auOpt match {
case Some(au) =>
val props = proj.properties :+ ("info.apiURL" -> au.toString)
proj.copy(properties = props)
case _ => proj
}
}
def coursierConfigurationTask(

View File

@ -91,10 +91,11 @@ object IvyXml {
}
)
val infoAttrs = project.module.attributes.foldLeft[xml.MetaData](xml.Null) {
case (acc, (k, v)) =>
new PrefixedAttribute("e", k, v, acc)
}
val infoAttrs =
(project.module.attributes.toSeq ++ project.properties).foldLeft[xml.MetaData](xml.Null) {
case (acc, (k, v)) =>
new PrefixedAttribute("e", k, v, acc)
}
val licenseElems = project.info.licenses.map {
case (name, urlOpt) =>