# HG changeset patch # User Tomas Zeman # Date 1595343687 -7200 # Node ID 7d705a7b18678e00d391c4a610fd1618e0abfcbb # Parent d101f632cc8d2008b0dd1d5cec2b3db14d3c6d3f mill, scala upgrade diff -r d101f632cc8d -r 7d705a7b1867 build.sc --- 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)() () } diff -r d101f632cc8d -r 7d705a7b1867 mill --- a/mill Thu Oct 24 13:10:50 2019 +0200 +++ b/mill Tue Jul 21 17:01:27 2020 +0200 @@ -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.1 +DEFAULT_MILL_VERSION=0.7.4 set -e @@ -17,13 +17,24 @@ 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#*.}" +MILL_MINOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}" if [ ! -x "$MILL_EXEC_PATH" ] ; then mkdir -p $MILL_DOWNLOAD_PATH + if [ "$MILL_MAJOR_VERSION" -gt 0 ] || [ "$MILL_MINOR_VERSION" -ge 5 ] ; then + ASSEMBLY="-assembly" + fi DOWNLOAD_FILE=$MILL_EXEC_PATH-tmp-download - MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION%%-*}/$MILL_VERSION-assembly" + MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION%%-*}/$MILL_VERSION${ASSEMBLY}" curl --fail -L -o "$DOWNLOAD_FILE" "$MILL_DOWNLOAD_URL" chmod +x "$DOWNLOAD_FILE" mv "$DOWNLOAD_FILE" "$MILL_EXEC_PATH"