# HG changeset patch # User Tomas Zeman # Date 1590592567 -7200 # Node ID 945e8df368003e7a124fac5678ae3bfd0200f0c4 # Parent 82080374cb75d7e6f2df47726ba65e9cf35b7d2c build: publishVersion, cleanup diff -r 82080374cb75 -r 945e8df36800 build.sc --- a/build.sc Wed May 27 17:08:01 2020 +0200 +++ b/build.sc Wed May 27 17:16:07 2020 +0200 @@ -18,8 +18,6 @@ trait Common extends CrossSbtModule with PublishModule { - def publishVersion: Target[String] = V.app - def pomSettings = PomSettings( description = "Scalatags DSL for purecss.io framework", organization = "functionals.cz", @@ -50,16 +48,16 @@ )} def hgId: Input[String] = T.input { - os.proc("hg", "id", "-i").call().out.string.trim + os.proc("hg", "id", "-i").call().out.text.trim } def hgNum: Input[String] = T.input { - os.proc("hg", "id", "-n").call().out.string.trim + os.proc("hg", "id", "-n").call().out.text.trim } private val maskedTags = Set("tip", "qtip", "qbase") def hgTag: Input[Option[String]] = T.input { - os.proc("hg", "id", "-t").call().out.string.trim.split(' ').filterNot(v => + os.proc("hg", "id", "-t").call().out.text.trim.split(' ').filterNot(v => maskedTags contains v).headOption } @@ -69,6 +67,10 @@ super.sources() :+ PathRef(millSourcePath / 'shared / 'src / 'main / 'scala) } + override def publishVersion: Input[String] = T.input{ + val tv = hgTag() map(v => "-" + v.replace(".patch", "")) getOrElse "" + V.app.replace("SNAPSHOT", s"${hgNum()}-${hgId()}$tv") + } } class JvmModule(val crossScalaVersion: String) extends Common