build.sc
changeset 8 7d705a7b1867
parent 7 d101f632cc8d
--- a/build.sc	Thu Oct 24 13:10:50 2019 +0200
+++ b/build.sc	Tue Jul 21 17:01:27 2020 +0200
@@ -1,6 +1,5 @@
-// mill 0.5.1
+// mill 0.7.4
 
-import ammonite.ops._
 import coursier.Repository
 import coursier.maven.MavenRepository
 import mill._
@@ -8,23 +7,21 @@
 import mill.scalajslib._
 import mill.scalalib._
 import mill.scalalib.publish._
-import $ivy.`de.tototec::de.tobiasroeser.mill.publishM2:0.1.0`
-import de.tobiasroeser.mill.publishM2._
 
 import scala.language.postfixOps
 
 object V {
   val spss4s = "0.1-SNAPSHOT"
-  val scalaJs = "0.6.26"
+  val scalaJs = "0.6.33"
   val scala211 = "2.11.12"
-  val scala212 = "2.12.8"
+  val scala212 = "2.12.12"
 }
 
 object D {
   val spssReader = ivy"com.bedatadriven.spss:spss-reader:1.3-SNAPSHOT"
 }
 
-trait Common extends CrossScalaModule with PublishM2Module {
+trait Common extends CrossScalaModule with PublishModule {
 
   override def artifactName: T[String] = "spss4s"
 
@@ -37,7 +34,7 @@
     V.spss4s.replace("SNAPSHOT", s"${hgNum()}-${hgId()}$tv")
   }
 
-  def pomSettings = PomSettings(
+  def pomSettings: Target[PomSettings] = PomSettings(
     description = "SPSS reader for Scala",
     organization = "net.tz",
     url = "https://hg.functionals.cz/spss4s",
@@ -65,15 +62,17 @@
   )}
 
   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(' ').headOption
+    os.proc("hg", "id", "-t").call().out.text.trim.split(' ').filterNot(v =>
+      maskedTags contains v).headOption
   }
 
   override def sources: Sources = T.sources(
@@ -104,10 +103,10 @@
 }
 
 def publishM2Local(p: os.Path): define.Command[Unit] = T.command{
-  jvm(V.scala212).publishM2Local(p)()
-  js(V.scala212).publishM2Local(p)()
-  jvm(V.scala211).publishM2Local(p)()
-  js(V.scala211).publishM2Local(p)()
+  jvm(V.scala212).publishM2Local(p.toString)()
+  js(V.scala212).publishM2Local(p.toString)()
+  jvm(V.scala211).publishM2Local(p.toString)()
+  js(V.scala211).publishM2Local(p.toString)()
   ()
 }