From 4fa9d27960052e28717ad6d8a04e456bba7d53d7 Mon Sep 17 00:00:00 2001 From: Anton Sviridov Date: Fri, 22 Mar 2024 10:24:02 +0000 Subject: [PATCH 1/3] Update versions, set Scala 3 to LTS (3.3) --- .mill-version | 2 +- .scalafmt.conf | 2 +- build.sc | 34 +++++++++++++++++----------------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.mill-version b/.mill-version index cd47247..70016a7 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -0.10.10 \ No newline at end of file +0.10.12 diff --git a/.scalafmt.conf b/.scalafmt.conf index 1f74907..d417d12 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.7.0" +version = "3.8.0" runner.dialect = scala213 maxColumn = 120 fileOverride { diff --git a/build.sc b/build.sc index 65cb1c1..4b65eea 100644 --- a/build.sc +++ b/build.sc @@ -1,7 +1,7 @@ import mill.define.Target import mill.util.Jvm import $ivy.`com.lihaoyi::mill-contrib-bloop:$MILL_VERSION` -import $ivy.`io.github.davidgregory084::mill-tpolecat::0.3.2` +import $ivy.`io.github.davidgregory084::mill-tpolecat::0.3.5` import $ivy.`io.chris-kipp::mill-ci-release::0.1.9` import os.Path @@ -15,15 +15,15 @@ import io.github.davidgregory084._ import io.kipp.mill.ci.release.CiReleaseModule object versions { - val scala212Version = "2.12.16" + val scala212Version = "2.12.1" val scala213Version = "2.13.11" - val scala3Version = "3.1.2" - val scalaJSVersion = "1.10.1" - val scalaNativeVersion = "0.4.11" - val munitVersion = "0.7.29" - val munitNativeVersion = "1.0.0-M7" - val fs2 = "3.3.0" - val weaver = "0.8.0" + val scala3Version = "3.3.3" + val scalaJSVersion = "1.14.0" + val scalaNativeVersion = "0.4.17" + val munitVersion = "1.0.0-M9" + val fs2Version = "3.10.0" + val weaverVersion = "0.8.3" + val jsoniterVersion = "2.17.0" val scala213 = "2.13" val scala212 = "2.12" @@ -40,7 +40,7 @@ import versions._ object core extends RPCCrossPlatformModule { cross => def crossPlatformIvyDeps: T[Agg[Dep]] = Agg( - ivy"com.github.plokhotnyuk.jsoniter-scala::jsoniter-scala-macros::2.17.0" + ivy"com.github.plokhotnyuk.jsoniter-scala::jsoniter-scala-macros::${jsoniterVersion}" ) object jvm extends mill.Cross[JvmModule](scala213, scala3) @@ -63,7 +63,7 @@ object fs2 extends RPCCrossPlatformModule { cross => override def crossPlatformModuleDeps = Seq(core) def crossPlatformIvyDeps: T[Agg[Dep]] = Agg( - ivy"co.fs2::fs2-core::${versions.fs2}" + ivy"co.fs2::fs2-core::${fs2Version}" ) object jvm extends mill.Cross[JvmModule](scala213, scala3) @@ -86,13 +86,13 @@ object fs2 extends RPCCrossPlatformModule { cross => object examples extends mill.define.Module { object server extends ScalaModule { - def ivyDeps = Agg(ivy"co.fs2::fs2-io:${versions.fs2}") + def ivyDeps = Agg(ivy"co.fs2::fs2-io:${fs2Version}") def moduleDeps = Seq(fs2.jvm(versions.scala213)) def scalaVersion = versions.scala213Version } object client extends ScalaModule { - def ivyDeps = Agg(ivy"co.fs2::fs2-io:${versions.fs2}") + def ivyDeps = Agg(ivy"co.fs2::fs2-io:$fs2Version") def moduleDeps = Seq(fs2.jvm(versions.scala213)) def scalaVersion = versions.scala213Version def forkEnv: Target[Map[String, String]] = T { @@ -118,7 +118,7 @@ trait RPCCrossPlatformModule extends Module { shared => override def platformLabel: String = "jvm" trait WeaverTests extends Tests { - def ivyDeps = super.ivyDeps() ++ Agg(ivy"com.disneystreaming::weaver-cats::$weaver") + def ivyDeps = super.ivyDeps() ++ Agg(ivy"com.disneystreaming::weaver-cats::$weaverVersion") def testFramework = "weaver.framework.CatsEffect" } @@ -144,7 +144,7 @@ trait RPCCrossPlatformModule extends Module { shared => override def skipIdea = true trait WeaverTests extends Tests { - def ivyDeps = super.ivyDeps() ++ Agg(ivy"com.disneystreaming::weaver-cats::$weaver") + def ivyDeps = super.ivyDeps() ++ Agg(ivy"com.disneystreaming::weaver-cats::$weaverVersion") def testFramework = "weaver.framework.CatsEffect" } @@ -180,12 +180,12 @@ trait RPCCrossPlatformModule extends Module { shared => override def skipBloop = true trait WeaverTests extends Tests { - def ivyDeps = super.ivyDeps() ++ Agg(ivy"com.disneystreaming::weaver-cats::$weaver") + def ivyDeps = super.ivyDeps() ++ Agg(ivy"com.disneystreaming::weaver-cats::$weaverVersion") def testFramework = "weaver.framework.CatsEffect" } trait MunitTests extends Tests with TestModule.Munit { - def ivyDeps = super.ivyDeps() ++ Agg(ivy"org.scalameta::munit::$munitNativeVersion") + def ivyDeps = super.ivyDeps() ++ Agg(ivy"org.scalameta::munit::$munitVersion") } trait Tests extends super.Tests with mill.contrib.Bloop.Module { From 42f91b704c9997feb40ae6c6aed2a356145c01b7 Mon Sep 17 00:00:00 2001 From: Anton Sviridov Date: Fri, 22 Mar 2024 10:25:21 +0000 Subject: [PATCH 2/3] Add mill launcher script --- mill | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 mill diff --git a/mill b/mill new file mode 100755 index 0000000..4f19f39 --- /dev/null +++ b/mill @@ -0,0 +1,49 @@ +#!/usr/bin/env sh + +# 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.10.12 + +set -e + +if [ -z "$MILL_VERSION" ] ; then + if [ -f ".mill-version" ] ; then + MILL_VERSION="$(head -n 1 .mill-version 2> /dev/null)" + elif [ -f "mill" ] && [ "$0" != "mill" ] ; then + MILL_VERSION=$(grep -F "DEFAULT_MILL_VERSION=" "mill" | head -n 1 | cut -d= -f2) + else + MILL_VERSION=$DEFAULT_MILL_VERSION + fi +fi + +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 [ ! -s "$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_VERSION_TAG=$(echo $MILL_VERSION | sed -E 's/([^-]+)(-M[0-9]+)?(-.*)?/\1\2/') + MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION_TAG}/$MILL_VERSION${ASSEMBLY}" + curl --fail -L -o "$DOWNLOAD_FILE" "$MILL_DOWNLOAD_URL" + chmod +x "$DOWNLOAD_FILE" + mv "$DOWNLOAD_FILE" "$MILL_EXEC_PATH" + unset DOWNLOAD_FILE + unset MILL_DOWNLOAD_URL +fi + +unset MILL_DOWNLOAD_PATH +unset MILL_VERSION + +exec $MILL_EXEC_PATH "$@" From 204a4c91543761ad598ae421f480450f674167de Mon Sep 17 00:00:00 2001 From: Anton Sviridov Date: Fri, 22 Mar 2024 10:42:44 +0000 Subject: [PATCH 3/3] Update Mill? --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e35b60..dfe3ad2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: - name: Setup Mill uses: jodersky/setup-mill@master with: - mill-version: 0.10.7 + mill-version: 0.10.12 - name: Run tests run: |