Skip to content

Commit 3c5970b

Browse files
committed
chore: refactor the runner and test-runner build configuration
1 parent a2d7ec1 commit 3c5970b

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

build.mill.scala

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,30 +1261,22 @@ trait CliIntegrationDocker extends SbtModule with ScalaCliPublishModule with Has
12611261
trait Runner extends SbtModule
12621262
with ScalaCliPublishModule
12631263
with ScalaCliScalafixModule {
1264-
override def scalaVersion: T[String] = Scala.scala3Lts
1264+
override def scalaVersion: T[String] = Scala.runnerScala3
12651265
override def scalacOptions: T[Seq[String]] = Task {
12661266
super.scalacOptions() ++ Seq("-release", "8", "-deprecation")
12671267
}
12681268
override def mainClass: T[Option[String]] = Some("scala.cli.runner.Runner")
12691269
override def sources: T[Seq[PathRef]] = Task.Sources {
1270-
val scala3DirNames =
1271-
if (scalaVersion().startsWith("3.")) {
1272-
val name =
1273-
if (scalaVersion().contains("-RC")) "scala-3-unstable"
1274-
else "scala-3-stable"
1275-
Seq(name)
1276-
}
1277-
else
1278-
Nil
1279-
val extraDirs = scala3DirNames.map(name => PathRef(moduleDir / "src" / "main" / name))
1270+
val scala3DirName = if (scalaVersion().contains("-RC")) "scala-3-unstable" else "scala-3-stable"
1271+
val extraDirs = Seq(PathRef(moduleDir / "src" / "main" / scala3DirName))
12801272
super.sources() ++ extraDirs
12811273
}
12821274
}
12831275

12841276
trait TestRunner extends SbtModule
12851277
with ScalaCliPublishModule
12861278
with ScalaCliScalafixModule {
1287-
override def scalaVersion: T[String] = Scala.scala3Lts
1279+
override def scalaVersion: T[String] = Scala.runnerScala3
12881280
override def scalacOptions: T[Seq[String]] = Task {
12891281
super.scalacOptions() ++ Seq("-release", "8", "-deprecation")
12901282
}

project/deps/package.mill.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object Scala {
3232
val allScala3 = Seq(scala3Lts, scala3Next, scala3NextAnnounced, scala3NextRc).distinct
3333
val all = (allScala2 ++ allScala3 ++ defaults).distinct
3434
val scala3MainVersions = (defaults ++ allScala3).distinct
35-
val runnerScalaVersions = Seq(runnerScala3, scala213)
35+
val runnerScalaVersions = Seq(runnerScala3, scala3MainVersions).distinct
3636

3737
def scalaJs = "1.20.1"
3838
def scalaJsCli = scalaJs // this must be compatible with the Scala.js version

0 commit comments

Comments
 (0)