mill upgrade 0.5.2 -> 0.9.4
authorTomas Zeman <tomas@functionals.cz>
Sat, 26 Dec 2020 11:34:08 +0100
changeset 35 b7cfac7cff27
parent 34 2b907c14fdcb
child 36 dfc839004878
mill upgrade 0.5.2 -> 0.9.4
build.sc
mill
--- a/build.sc	Sat Dec 26 11:16:10 2020 +0100
+++ b/build.sc	Sat Dec 26 11:34:08 2020 +0100
@@ -1,7 +1,7 @@
 /*
  * REPL:
  *
- * ./mill -i -w
+ * ./mill --repl -w
  *
  * Generate Idea project:
  *
@@ -15,8 +15,6 @@
 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
 
@@ -41,7 +39,7 @@
   inner(s toList) mkString ""
 }
 
-trait Common extends CrossSbtModule with PublishM2Module {
+trait Common extends CrossSbtModule with PublishModule {
 
   override def artifactName = "fatags"
 
@@ -71,19 +69,19 @@
     "-unchecked",                        // Enable additional warnings where generated code depends on assumptions.
     "-Xcheckinit",                       // Wrap field accessors to throw an exception on uninitialized access.
     "-Xfuture",                          // Turn on future language features.
-    "-target:jvm-1.8",
+    "-target:jvm-1.8"
   )}
 
   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
   }
 
   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(' ').headOption
   }
 
   override def ivyDeps: Target[Loose.Agg[Dep]] = Agg(D.scalatags)
@@ -155,10 +153,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)()
   ()
 }
 
--- a/mill	Sat Dec 26 11:16:10 2020 +0100
+++ b/mill	Sat Dec 26 11:34:08 2020 +0100
@@ -3,7 +3,7 @@
 # This is a wrapper script, that automatically download mill from GitHub release pages
 # You can give the required mill version with MILL_VERSION env variable
 # If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
-DEFAULT_MILL_VERSION=0.5.2
+DEFAULT_MILL_VERSION=0.9.4
 
 set -e
 
@@ -17,8 +17,12 @@
   fi
 fi
 
-MILL_DOWNLOAD_PATH="$HOME/.mill/download"
-MILL_EXEC_PATH="${MILL_DOWNLOAD_PATH}/$MILL_VERSION"
+if [ "x${XDG_CACHE_HOME}" != "x" ] ; then
+  MILL_DOWNLOAD_PATH="${XDG_CACHE_HOME}/mill/download"
+else
+  MILL_DOWNLOAD_PATH="${HOME}/.cache/mill/download"
+fi
+MILL_EXEC_PATH="${MILL_DOWNLOAD_PATH}/${MILL_VERSION}"
 
 version_remainder="$MILL_VERSION"
 MILL_MAJOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}"
@@ -26,7 +30,7 @@
 
 if [ ! -x "$MILL_EXEC_PATH" ] ; then
   mkdir -p $MILL_DOWNLOAD_PATH
-  if [ $MILL_MAJOR_VERSION -gt 0 ] || [ $MILL_MINOR_VERSION -ge 5 ] ; then
+  if [ "$MILL_MAJOR_VERSION" -gt 0 ] || [ "$MILL_MINOR_VERSION" -ge 5 ] ; then
     ASSEMBLY="-assembly"
   fi
   DOWNLOAD_FILE=$MILL_EXEC_PATH-tmp-download