diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 4f1ef90..e216cbe 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -23,7 +23,7 @@ jobs: distribution: 'temurin' java-version: ${{ matrix.java }} - name: Run tests - run: ./mill -i all __.publishArtifacts __.test + run: ./mill -i __.publishArtifacts + __.test check-binary-compatibility: runs-on: ubuntu-latest diff --git a/.mill-version b/.mill-version index 223df19..1a77547 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -0.10.11 +0.11.11 diff --git a/build.sc b/build.sc index 43605e9..8a4f9a6 100644 --- a/build.sc +++ b/build.sc @@ -1,30 +1,33 @@ import mill._, scalalib._, scalajslib._, scalanativelib._, publish._ -import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.3.0` +import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0` import de.tobiasroeser.mill.vcs.version.VcsVersion -import $ivy.`com.github.lolgab::mill-mima::0.0.13` +import $ivy.`com.github.lolgab::mill-mima::0.1.1` import com.github.lolgab.mill.mima._ -import mill.scalalib.api.Util.isScala3 +import mill.scalalib.api.ZincWorkerUtil.isScala3 val communityBuildDottyVersion = sys.props.get("dottyVersion").toList -val scala212 = "2.12.17" -val scala213 = "2.13.10" -val scala3 = "3.1.3" +val scala212 = "2.12.19" +val scala213 = "2.13.13" +val scala3 = "3.3.3" val scalaVersions = scala3 :: scala213 :: scala212 :: communityBuildDottyVersion -val scalaJSVersions = scalaVersions.map((_, "1.13.0")) -val scalaNativeVersions = scalaVersions.map((_, "0.4.10")) - trait MimaCheck extends Mima { def mimaPreviousVersions = VcsVersion.vcsState().lastTag.toSeq } object castor extends Module { - abstract class ActorModule(crossVersion: String) extends CrossScalaModule with PublishModule with MimaCheck { + trait PlatformModule { + def platformSegment: String = this match { + case _: ScalaJSModule => "js" + case _: ScalaNativeModule => "native" + case _ => "jvm" + } + } + trait ActorModule extends CrossScalaModule with PublishModule with MimaCheck with PlatformModule { def publishVersion = VcsVersion.vcsState().format() - def crossScalaVersion = crossVersion def pomSettings = PomSettings( description = artifactName(), organization = "com.lihaoyi", @@ -37,7 +40,6 @@ object castor extends Module { ) def artifactName = "castor" - def platformSegment: String def millSourcePath = super.millSourcePath / os.up def sources = T.sources( @@ -45,50 +47,42 @@ object castor extends Module { millSourcePath / s"src-$platformSegment" ) - def ivyDeps = Agg(ivy"com.lihaoyi::sourcecode::0.3.0") + def ivyDeps = Agg(ivy"com.lihaoyi::sourcecode::0.4.1") } - trait ActorTestModule extends ScalaModule with TestModule.Utest { - def platformSegment: String + trait ActorTestModule extends ScalaModule with TestModule.Utest with PlatformModule { def sources = T.sources( millSourcePath / "src", millSourcePath / s"src-$platformSegment" ) - def ivyDeps = Agg(ivy"com.lihaoyi::utest::0.8.1") + def ivyDeps = Agg(ivy"com.lihaoyi::utest::0.8.3") } - object js extends Cross[ActorJsModule](scalaJSVersions:_*) - class ActorJsModule(crossScalaVersion: String, crossScalaJsVersion: String) extends ActorModule(crossScalaVersion) with ScalaJSModule { - def platformSegment = "js" - def scalaJSVersion = crossScalaJsVersion - def millSourcePath = super.millSourcePath / os.up + object js extends Cross[ActorJsModule](scalaVersions) + trait ActorJsModule extends ActorModule with ScalaJSModule { + def scalaJSVersion = "1.16.0" override def sources = T.sources { super.sources() ++ Seq(PathRef(millSourcePath / "src-js-native")) } - object test extends Tests with ActorTestModule { - def platformSegment = "js" + object test extends ScalaJSTests with ActorTestModule { def scalaVersion = crossScalaVersion } } - object jvm extends Cross[ActorJvmModule](scalaVersions: _*) - class ActorJvmModule(crossScalaVersion: String) extends ActorModule(crossScalaVersion) { - def platformSegment = "jvm" - object test extends Tests with ActorTestModule{ - def platformSegment: String = "jvm" + object jvm extends Cross[ActorJvmModule](scalaVersions) + trait ActorJvmModule extends ActorModule { + object test extends ScalaTests with ActorTestModule{ def ivyDeps = super.ivyDeps() ++ Agg( ivy"com.lihaoyi::os-lib:0.9.1" ) } } - object native extends Cross[ActorNativeModule](scalaNativeVersions:_*) - class ActorNativeModule(crossScalaVersion: String, crossScalaNativeVersion: String) extends ActorModule(crossScalaVersion) with ScalaNativeModule { - def platformSegment = "native" - def scalaNativeVersion = crossScalaNativeVersion - def millSourcePath = super.millSourcePath / os.up + object native extends Cross[ActorNativeModule](scalaVersions) + trait ActorNativeModule extends ActorModule with ScalaNativeModule { + def scalaNativeVersion = "0.5.4" + // Enable after first release for Scala Native 0.5 + def mimaPreviousArtifacts = T { Agg.empty } override def sources = T.sources { super.sources() ++ Seq(PathRef(millSourcePath / "src-js-native")) } - object test extends Tests with ActorTestModule { - def platformSegment = "native" - } + object test extends ScalaNativeTests with ActorTestModule } } diff --git a/mill b/mill index e616548..81ca72e 100755 --- a/mill +++ b/mill @@ -3,13 +3,18 @@ # 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.5 set -e +if [ -z "${DEFAULT_MILL_VERSION}" ] ; then + DEFAULT_MILL_VERSION=0.11.11 +fi + if [ -z "$MILL_VERSION" ] ; then if [ -f ".mill-version" ] ; then MILL_VERSION="$(head -n 1 .mill-version 2> /dev/null)" + elif [ -f ".config/mill-version" ] ; then + MILL_VERSION="$(head -n 1 .config/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 @@ -35,7 +40,7 @@ if [ ! -s "$MILL_EXEC_PATH" ] ; then 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}" + MILL_DOWNLOAD_URL="https://repo1.maven.org/maven2/com/lihaoyi/mill-dist/$MILL_VERSION/mill-dist-$MILL_VERSION.jar" curl --fail -L -o "$DOWNLOAD_FILE" "$MILL_DOWNLOAD_URL" chmod +x "$DOWNLOAD_FILE" mv "$DOWNLOAD_FILE" "$MILL_EXEC_PATH" @@ -43,7 +48,20 @@ if [ ! -s "$MILL_EXEC_PATH" ] ; then unset MILL_DOWNLOAD_URL fi +if [ -z "$MILL_MAIN_CLI" ] ; then + MILL_MAIN_CLI="${0}" +fi + +MILL_FIRST_ARG="" + + # first arg is a long flag for "--interactive" or starts with "-i" +if [ "$1" = "--bsp" ] || [ "${1#"-i"}" != "$1" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--repl" ] || [ "$1" = "--help" ] ; then + # Need to preserve the first position of those listed options + MILL_FIRST_ARG=$1 + shift +fi + unset MILL_DOWNLOAD_PATH unset MILL_VERSION -exec $MILL_EXEC_PATH "$@" +exec $MILL_EXEC_PATH $MILL_FIRST_ARG -D "mill.main.cli=${MILL_MAIN_CLI}" "$@"