Skip to content

Commit

Permalink
Update Scala Native to 0.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
lolgab committed Aug 12, 2024
1 parent aaf3d6b commit 9115bfb
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .mill-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.11
0.11.11
64 changes: 28 additions & 36 deletions build.sc
Original file line number Diff line number Diff line change
@@ -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.0`
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",
Expand All @@ -37,58 +40,47 @@ object castor extends Module {
)

def artifactName = "castor"
def platformSegment: String
def millSourcePath = super.millSourcePath / os.up

def sources = T.sources(
millSourcePath / "src",
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"
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
}
}
24 changes: 21 additions & 3 deletions mill
Original file line number Diff line number Diff line change
Expand Up @@ -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.7-70-654f58
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
Expand All @@ -35,15 +40,28 @@ 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"
unset DOWNLOAD_FILE
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}" "$@"

0 comments on commit 9115bfb

Please sign in to comment.