From dcc81705325fac54d83d34100b667a699662e0d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Art=C5=ABras=20=C5=A0lajus?= Date: Wed, 25 Jun 2025 12:32:09 +0300 Subject: [PATCH 1/7] Adds support for `//| mill-scala-library-version: 3.7.2-RC1` frontmatter. --- .../src/mill/launcher/CoursierClient.scala | 32 +++++++++++----- .../mill/launcher/MillProcessLauncher.java | 38 +++++++++++++++++-- .../modules/ROOT/pages/cli/build-header.adoc | 18 +++++++++ 3 files changed, 74 insertions(+), 14 deletions(-) diff --git a/runner/launcher/src/mill/launcher/CoursierClient.scala b/runner/launcher/src/mill/launcher/CoursierClient.scala index 1a1bc1dfa623..dbb296916dda 100644 --- a/runner/launcher/src/mill/launcher/CoursierClient.scala +++ b/runner/launcher/src/mill/launcher/CoursierClient.scala @@ -12,32 +12,44 @@ import scala.concurrent.duration.Duration import mill.coursierutil.TestOverridesRepo object CoursierClient { - def resolveMillDaemon() = { + /** + * Resolves the classpath for the mill daemon. + * + * @param scalaLibraryVersion the version of the scala library to use. If not specified, the version from the + * mill build is used. + */ + def resolveMillDaemon(scalaLibraryVersion: Option[String]): Array[String] = { val repositories = Await.result(Resolve().finalRepositories.future(), Duration.Inf) val coursierCache0 = FileCache[Task]() .withLogger(coursier.cache.loggers.RefreshLogger.create()) - val artifactsResultOrError = { - + val artifactsResult = { val resolve = Resolve() .withCache(coursierCache0) - .withDependencies(Seq(Dependency( - Module(Organization("com.lihaoyi"), ModuleName("mill-runner-daemon_3"), Map()), - VersionConstraint(mill.client.BuildInfo.millVersion) - ))) + .withDependencies(Seq( + Dependency( + Module(Organization("com.lihaoyi"), ModuleName("mill-runner-daemon_3"), attributes = Map.empty), + VersionConstraint(mill.client.BuildInfo.millVersion) + ) + ) ++ scalaLibraryVersion.map { version => + Dependency( + Module(Organization("org.scala-lang"), ModuleName("scala3-library_3"), attributes = Map.empty), + VersionConstraint(version) + ) + }) .withRepositories(Seq(TestOverridesRepo) ++ repositories) resolve.either() match { case Left(err) => sys.error(err.toString) - case Right(v) => + case Right(resolution) => Artifacts(coursierCache0) - .withResolution(v) + .withResolution(resolution) .eitherResult() .right.get } } - artifactsResultOrError.artifacts.map(_._2.toString).toArray + artifactsResult.artifacts.iterator.map { case (_, file) => file.toString }.toArray } def resolveJavaHome(id: String): java.io.File = { diff --git a/runner/launcher/src/mill/launcher/MillProcessLauncher.java b/runner/launcher/src/mill/launcher/MillProcessLauncher.java index 01bce96f905c..0400b09ce9ac 100644 --- a/runner/launcher/src/mill/launcher/MillProcessLauncher.java +++ b/runner/launcher/src/mill/launcher/MillProcessLauncher.java @@ -19,6 +19,9 @@ import mill.constants.CodeGenConstants; import mill.constants.DaemonFiles; import mill.constants.EnvVars; +import scala.None; +import scala.None$; +import scala.Option$; public class MillProcessLauncher { @@ -120,11 +123,11 @@ static List loadMillConfig(String key) throws Exception { Object conf = mill.launcher.ConfigReader.readYaml( buildFile, buildFile.getFileName().toString()); if (!(conf instanceof Map)) return new String[] {}; - Map conf2 = (Map) conf; + @SuppressWarnings("unchecked") Map conf2 = (Map) conf; if (!conf2.containsKey(key)) return new String[] {}; if (conf2.get(key) instanceof List) { - List list = (List) conf2.get(key); + @SuppressWarnings("unchecked") List list = (List) conf2.get(key); String[] arr = new String[list.size()]; for (int i = 0; i < arr.length; i++) { arr[i] = mill.constants.Util.interpolateEnvVars(list.get(i), env); @@ -152,7 +155,15 @@ static List millOpts() throws Exception { } static String millJvmVersion() throws Exception { - List res = loadMillConfig("mill-jvm-version"); + return loadMillConfigSingleValue("mill-jvm-version"); + } + + static String millScalaLibraryVersion() throws Exception { + return loadMillConfigSingleValue("mill-scala-library-version"); + } + + static String loadMillConfigSingleValue(String key) throws Exception { + List res = loadMillConfig(key); if (res.isEmpty()) return null; else return res.get(0); } @@ -228,10 +239,16 @@ static List millLaunchJvmCommand() throws Exception { // extra opts vmOptions.addAll(millJvmOpts()); + var maybeScalaLibraryVersion = millScalaLibraryVersion(); vmOptions.add("-XX:+HeapDumpOnOutOfMemoryError"); vmOptions.add("-cp"); + var classPathCacheKey = + "mill:" + BuildInfo.millVersion + + ",scala-library-version:" + (maybeScalaLibraryVersion == null ? "default" : maybeScalaLibraryVersion); String[] runnerClasspath = cachedComputedValue0( - "resolve-runner", BuildInfo.millVersion, () -> CoursierClient.resolveMillDaemon(), arr -> { + "resolve-runner", classPathCacheKey, + () -> CoursierClient.resolveMillDaemon(Option$.MODULE$.apply(maybeScalaLibraryVersion)), + arr -> { for (String s : arr) { if (!Files.exists(Paths.get(s))) return false; } @@ -246,6 +263,19 @@ static String[] cachedComputedValue(String name, String key, Supplier return cachedComputedValue0(name, key, block, arr -> true); } + /** + * Loads a value from the cache, or computes it if it's not in the cache, or re-computes it if it's + * in the cache but invalid. + *

+ * The cache is stored in the `out/mill-{name}` file and contains only a single key. + * + * @param name name of the cached value + * @param key key of the value in the cache. If the cache exists but the key doesn't match, the value + * will be re-computed. + * @param block block to compute the value + * @param validate function to validate the value. If the value is in cache but invalid, it will be + * re-computed. + */ static String[] cachedComputedValue0( String name, String key, Supplier block, Function validate) { try { diff --git a/website/docs/modules/ROOT/pages/cli/build-header.adoc b/website/docs/modules/ROOT/pages/cli/build-header.adoc index b907ab47ee57..0a2e32090a8e 100644 --- a/website/docs/modules/ROOT/pages/cli/build-header.adoc +++ b/website/docs/modules/ROOT/pages/cli/build-header.adoc @@ -15,6 +15,7 @@ For example, a build header may look something like: //| mill-opts: ["--jobs=0.5C"] //| mill-jvm-version: temurin:11 //| mill-jvm-opts: ["-XX:NonProfiledCodeHeapSize=250m", "-XX:ReservedCodeCacheSize=500m"] +//| mill-scala-library-version: 3.7.2-RC1 //| # newlines are allowed too //| //| repositories: @@ -125,3 +126,20 @@ _build.mill_ Missing environment variables are converted to the empty string. +== mill-scala-library-version + +Mill allows you to specify the exact scala-library version you want to use for your build +via a `mill-scala-library-version` key in the build header: + +_build.mill_ + +[source] +---- +//| mill-scala-library-version: 3.7.2-RC1 +---- + +This allows you to use newer versions of the scala-library than the version used by Mill +itself, as long as the version you use is backwards compatible. + +If `mill-scala-library-version` is not provided, Mill uses the version of scala-library +used by Mill itself. From 62989aa71b9c27ef44dc6901f6539a65e22fa3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Art=C5=ABras=20=C5=A0lajus?= Date: Wed, 25 Jun 2025 12:36:12 +0300 Subject: [PATCH 2/7] Cleanup imports. --- runner/launcher/src/mill/launcher/MillProcessLauncher.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/runner/launcher/src/mill/launcher/MillProcessLauncher.java b/runner/launcher/src/mill/launcher/MillProcessLauncher.java index 0400b09ce9ac..e28df09b962e 100644 --- a/runner/launcher/src/mill/launcher/MillProcessLauncher.java +++ b/runner/launcher/src/mill/launcher/MillProcessLauncher.java @@ -19,8 +19,6 @@ import mill.constants.CodeGenConstants; import mill.constants.DaemonFiles; import mill.constants.EnvVars; -import scala.None; -import scala.None$; import scala.Option$; public class MillProcessLauncher { From 37207d59309d3cc8c40eb929b5d7072751f0b4aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Art=C5=ABras=20=C5=A0lajus?= Date: Wed, 25 Jun 2025 13:27:54 +0300 Subject: [PATCH 3/7] Change the scala compiler version, not scala library version. --- runner/launcher/src/mill/launcher/CoursierClient.scala | 10 +++++----- .../src/mill/launcher/MillProcessLauncher.java | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/runner/launcher/src/mill/launcher/CoursierClient.scala b/runner/launcher/src/mill/launcher/CoursierClient.scala index dbb296916dda..9a6cd2c63472 100644 --- a/runner/launcher/src/mill/launcher/CoursierClient.scala +++ b/runner/launcher/src/mill/launcher/CoursierClient.scala @@ -15,10 +15,10 @@ object CoursierClient { /** * Resolves the classpath for the mill daemon. * - * @param scalaLibraryVersion the version of the scala library to use. If not specified, the version from the - * mill build is used. + * @param scalaVersion the version of the Scala to use. If not specified, the version that mill uses itself will be + * used. */ - def resolveMillDaemon(scalaLibraryVersion: Option[String]): Array[String] = { + def resolveMillDaemon(scalaVersion: Option[String]): Array[String] = { val repositories = Await.result(Resolve().finalRepositories.future(), Duration.Inf) val coursierCache0 = FileCache[Task]() .withLogger(coursier.cache.loggers.RefreshLogger.create()) @@ -31,9 +31,9 @@ object CoursierClient { Module(Organization("com.lihaoyi"), ModuleName("mill-runner-daemon_3"), attributes = Map.empty), VersionConstraint(mill.client.BuildInfo.millVersion) ) - ) ++ scalaLibraryVersion.map { version => + ) ++ scalaVersion.map { version => Dependency( - Module(Organization("org.scala-lang"), ModuleName("scala3-library_3"), attributes = Map.empty), + Module(Organization("org.scala-lang"), ModuleName("scala3-compiler_3"), attributes = Map.empty), VersionConstraint(version) ) }) diff --git a/runner/launcher/src/mill/launcher/MillProcessLauncher.java b/runner/launcher/src/mill/launcher/MillProcessLauncher.java index e28df09b962e..7dec595b866a 100644 --- a/runner/launcher/src/mill/launcher/MillProcessLauncher.java +++ b/runner/launcher/src/mill/launcher/MillProcessLauncher.java @@ -156,8 +156,8 @@ static String millJvmVersion() throws Exception { return loadMillConfigSingleValue("mill-jvm-version"); } - static String millScalaLibraryVersion() throws Exception { - return loadMillConfigSingleValue("mill-scala-library-version"); + static String millScalaVersion() throws Exception { + return loadMillConfigSingleValue("mill-scala-version"); } static String loadMillConfigSingleValue(String key) throws Exception { @@ -237,15 +237,15 @@ static List millLaunchJvmCommand() throws Exception { // extra opts vmOptions.addAll(millJvmOpts()); - var maybeScalaLibraryVersion = millScalaLibraryVersion(); + var maybeScalaVersion = millScalaVersion(); vmOptions.add("-XX:+HeapDumpOnOutOfMemoryError"); vmOptions.add("-cp"); var classPathCacheKey = "mill:" + BuildInfo.millVersion + - ",scala-library-version:" + (maybeScalaLibraryVersion == null ? "default" : maybeScalaLibraryVersion); + ",scala:" + (maybeScalaVersion == null ? "default" : maybeScalaVersion); String[] runnerClasspath = cachedComputedValue0( "resolve-runner", classPathCacheKey, - () -> CoursierClient.resolveMillDaemon(Option$.MODULE$.apply(maybeScalaLibraryVersion)), + () -> CoursierClient.resolveMillDaemon(Option$.MODULE$.apply(maybeScalaVersion)), arr -> { for (String s : arr) { if (!Files.exists(Paths.get(s))) return false; From b35b17093de12a8f975163ff94c5a1a00b34ed1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Art=C5=ABras=20=C5=A0lajus?= Date: Wed, 25 Jun 2025 14:11:01 +0300 Subject: [PATCH 4/7] Change the scala compiler version, not scala library version + tests. --- .../src/mill/constants/CacheFiles.java | 15 ++++ .../mill-scala-version/resources/.directory | 0 .../src/MillScalaVersionTests.scala | 82 +++++++++++++++++++ .../mill/launcher/MillProcessLauncher.java | 13 ++- 4 files changed, 102 insertions(+), 8 deletions(-) create mode 100644 core/constants/src/mill/constants/CacheFiles.java create mode 100644 integration/feature/mill-scala-version/resources/.directory create mode 100644 integration/feature/mill-scala-version/src/MillScalaVersionTests.scala diff --git a/core/constants/src/mill/constants/CacheFiles.java b/core/constants/src/mill/constants/CacheFiles.java new file mode 100644 index 000000000000..6a7053d643f8 --- /dev/null +++ b/core/constants/src/mill/constants/CacheFiles.java @@ -0,0 +1,15 @@ +package mill.constants; + +public class CacheFiles { + /** Prefix for all cache files. */ + public static final String prefix = "mill-"; + + public static String filename(String name) { + return prefix + name; + } + + public static final String javaHome = "java-home"; + + /** Caches the classpath for the mill runner. */ + public static final String resolveRunner = "resolve-runner"; +} diff --git a/integration/feature/mill-scala-version/resources/.directory b/integration/feature/mill-scala-version/resources/.directory new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/integration/feature/mill-scala-version/src/MillScalaVersionTests.scala b/integration/feature/mill-scala-version/src/MillScalaVersionTests.scala new file mode 100644 index 000000000000..3b44160421dd --- /dev/null +++ b/integration/feature/mill-scala-version/src/MillScalaVersionTests.scala @@ -0,0 +1,82 @@ +package mill.integration + +import mill.constants.CacheFiles +import mill.testkit.{IntegrationTester, UtestIntegrationTestSuite} +import utest.* + +object MillScalaVersionTests extends UtestIntegrationTestSuite { + private def writeBuildMill(tester: IntegrationTester, scalaVersion: Option[String]): Unit = { + val scalaVersionLine = scalaVersion.fold("")(v => s"//| mill-scala-version: $v") + os.write.over( + tester.workspacePath / "build.mill", + s"""$scalaVersionLine + |package build + | + |// empty file + |""".stripMargin + ) + } + + private def readResolveRunner(tester: IntegrationTester) = + os.read.lines(tester.workspacePath / "out" / CacheFiles.filename(CacheFiles.resolveRunner)) + + private def scalaLibraryFor(version: String) = + s"org/scala-lang/scala3-library_3/$version/scala3-library_3-$version.jar" + + private def scalaCompilerFor(version: String) = + s"org/scala-lang/scala3-compiler_3/$version/scala3-compiler_3-$version.jar" + + private val ScalaVersion = "3.7.2-RC1" + + val tests: Tests = Tests { + test("noDirective") - integrationTest { tester => + import tester.* + + writeBuildMill(tester, scalaVersion = None) + val res = eval("version") + assert(res.isSuccess) + + val lines = readResolveRunner(tester) + assert(!lines.exists(_.contains(scalaCompilerFor(ScalaVersion)))) + assert(!lines.exists(_.contains(scalaLibraryFor(ScalaVersion)))) + } + + test("withDirective") - integrationTest { tester => + import tester.* + + writeBuildMill(tester, scalaVersion = Some(ScalaVersion)) + val res = eval("version") + assert(res.isSuccess) + + val lines = readResolveRunner(tester) + assert(lines.exists(_.contains(scalaCompilerFor(ScalaVersion)))) + assert(lines.exists(_.contains(scalaLibraryFor(ScalaVersion)))) + } + + test("withDirectiveAndThenWithout") - integrationTest { tester => + import tester.* + + { + writeBuildMill(tester, scalaVersion = Some(ScalaVersion)) + val res = eval("version") + assert(res.isSuccess) + + val lines = readResolveRunner(tester) + assert(lines.exists(_.contains(scalaCompilerFor(ScalaVersion)))) + assert(lines.exists(_.contains(scalaLibraryFor(ScalaVersion)))) + } + + { + // This should recompile the build with the new version. + writeBuildMill(tester, scalaVersion = None) + val res = eval("version") + assert(res.isSuccess) + + val lines = readResolveRunner(tester) + assert(!lines.exists(_.contains(scalaCompilerFor(ScalaVersion)))) + assert(!lines.exists(_.contains(scalaLibraryFor(ScalaVersion)))) + } + } + + } +} diff --git a/runner/launcher/src/mill/launcher/MillProcessLauncher.java b/runner/launcher/src/mill/launcher/MillProcessLauncher.java index 7dec595b866a..49666be8ba8b 100644 --- a/runner/launcher/src/mill/launcher/MillProcessLauncher.java +++ b/runner/launcher/src/mill/launcher/MillProcessLauncher.java @@ -15,10 +15,7 @@ import java.util.function.Supplier; import java.util.stream.Stream; import mill.client.ClientUtil; -import mill.constants.BuildInfo; -import mill.constants.CodeGenConstants; -import mill.constants.DaemonFiles; -import mill.constants.EnvVars; +import mill.constants.*; import scala.Option$; public class MillProcessLauncher { @@ -192,7 +189,7 @@ static String javaHome() throws Exception { if (jvmId != null) { final String jvmIdFinal = jvmId; javaHome = cachedComputedValue0( - "java-home", + CacheFiles.javaHome, jvmId, () -> new String[] {CoursierClient.resolveJavaHome(jvmIdFinal).getAbsolutePath()}, // Make sure we check to see if the saved java home exists before using @@ -241,10 +238,10 @@ static List millLaunchJvmCommand() throws Exception { vmOptions.add("-XX:+HeapDumpOnOutOfMemoryError"); vmOptions.add("-cp"); var classPathCacheKey = - "mill:" + BuildInfo.millVersion + + "mill:" + BuildInfo.millVersion + ",scala:" + (maybeScalaVersion == null ? "default" : maybeScalaVersion); String[] runnerClasspath = cachedComputedValue0( - "resolve-runner", classPathCacheKey, + CacheFiles.resolveRunner, classPathCacheKey, () -> CoursierClient.resolveMillDaemon(Option$.MODULE$.apply(maybeScalaVersion)), arr -> { for (String s : arr) { @@ -277,7 +274,7 @@ static String[] cachedComputedValue(String name, String key, Supplier static String[] cachedComputedValue0( String name, String key, Supplier block, Function validate) { try { - Path cacheFile = Paths.get(".").resolve(out).resolve("mill-" + name); + Path cacheFile = Paths.get(".").resolve(out).resolve(CacheFiles.filename(name)); String[] value = null; if (Files.exists(cacheFile)) { String[] savedInfo = Files.readString(cacheFile).split("\n"); From f7824116a5b052378a169337a191718308c7b57e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Art=C5=ABras=20=C5=A0lajus?= Date: Wed, 25 Jun 2025 14:12:26 +0300 Subject: [PATCH 5/7] scalafmt --- .../launcher/src/mill/launcher/CoursierClient.scala | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/runner/launcher/src/mill/launcher/CoursierClient.scala b/runner/launcher/src/mill/launcher/CoursierClient.scala index 9a6cd2c63472..4e15b374e3ae 100644 --- a/runner/launcher/src/mill/launcher/CoursierClient.scala +++ b/runner/launcher/src/mill/launcher/CoursierClient.scala @@ -12,6 +12,7 @@ import scala.concurrent.duration.Duration import mill.coursierutil.TestOverridesRepo object CoursierClient { + /** * Resolves the classpath for the mill daemon. * @@ -28,12 +29,20 @@ object CoursierClient { .withCache(coursierCache0) .withDependencies(Seq( Dependency( - Module(Organization("com.lihaoyi"), ModuleName("mill-runner-daemon_3"), attributes = Map.empty), + Module( + Organization("com.lihaoyi"), + ModuleName("mill-runner-daemon_3"), + attributes = Map.empty + ), VersionConstraint(mill.client.BuildInfo.millVersion) ) ) ++ scalaVersion.map { version => Dependency( - Module(Organization("org.scala-lang"), ModuleName("scala3-compiler_3"), attributes = Map.empty), + Module( + Organization("org.scala-lang"), + ModuleName("scala3-compiler_3"), + attributes = Map.empty + ), VersionConstraint(version) ) }) From 00fc2d77a3888d01e0afedaac4ec3a96827eeff7 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 11:14:33 +0000 Subject: [PATCH 6/7] [autofix.ci] apply automated fixes --- .../src/mill/launcher/MillProcessLauncher.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/runner/launcher/src/mill/launcher/MillProcessLauncher.java b/runner/launcher/src/mill/launcher/MillProcessLauncher.java index 49666be8ba8b..945cc021a18c 100644 --- a/runner/launcher/src/mill/launcher/MillProcessLauncher.java +++ b/runner/launcher/src/mill/launcher/MillProcessLauncher.java @@ -118,11 +118,13 @@ static List loadMillConfig(String key) throws Exception { Object conf = mill.launcher.ConfigReader.readYaml( buildFile, buildFile.getFileName().toString()); if (!(conf instanceof Map)) return new String[] {}; - @SuppressWarnings("unchecked") Map conf2 = (Map) conf; + @SuppressWarnings("unchecked") + Map conf2 = (Map) conf; if (!conf2.containsKey(key)) return new String[] {}; if (conf2.get(key) instanceof List) { - @SuppressWarnings("unchecked") List list = (List) conf2.get(key); + @SuppressWarnings("unchecked") + List list = (List) conf2.get(key); String[] arr = new String[list.size()]; for (int i = 0; i < arr.length; i++) { arr[i] = mill.constants.Util.interpolateEnvVars(list.get(i), env); @@ -237,13 +239,13 @@ static List millLaunchJvmCommand() throws Exception { var maybeScalaVersion = millScalaVersion(); vmOptions.add("-XX:+HeapDumpOnOutOfMemoryError"); vmOptions.add("-cp"); - var classPathCacheKey = - "mill:" + BuildInfo.millVersion + - ",scala:" + (maybeScalaVersion == null ? "default" : maybeScalaVersion); + var classPathCacheKey = "mill:" + BuildInfo.millVersion + ",scala:" + + (maybeScalaVersion == null ? "default" : maybeScalaVersion); String[] runnerClasspath = cachedComputedValue0( - CacheFiles.resolveRunner, classPathCacheKey, - () -> CoursierClient.resolveMillDaemon(Option$.MODULE$.apply(maybeScalaVersion)), - arr -> { + CacheFiles.resolveRunner, + classPathCacheKey, + () -> CoursierClient.resolveMillDaemon(Option$.MODULE$.apply(maybeScalaVersion)), + arr -> { for (String s : arr) { if (!Files.exists(Paths.get(s))) return false; } From 26c07b3ffbe341271e7b1b94ada2c8afbf0b8dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Art=C5=ABras=20=C5=A0lajus?= Date: Wed, 25 Jun 2025 14:15:21 +0300 Subject: [PATCH 7/7] fix docs --- .../docs/modules/ROOT/pages/cli/build-header.adoc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/website/docs/modules/ROOT/pages/cli/build-header.adoc b/website/docs/modules/ROOT/pages/cli/build-header.adoc index 0a2e32090a8e..adfa84ce8ca7 100644 --- a/website/docs/modules/ROOT/pages/cli/build-header.adoc +++ b/website/docs/modules/ROOT/pages/cli/build-header.adoc @@ -15,7 +15,7 @@ For example, a build header may look something like: //| mill-opts: ["--jobs=0.5C"] //| mill-jvm-version: temurin:11 //| mill-jvm-opts: ["-XX:NonProfiledCodeHeapSize=250m", "-XX:ReservedCodeCacheSize=500m"] -//| mill-scala-library-version: 3.7.2-RC1 +//| mill-scala-version: 3.7.2-RC1 //| # newlines are allowed too //| //| repositories: @@ -126,20 +126,20 @@ _build.mill_ Missing environment variables are converted to the empty string. -== mill-scala-library-version +== mill-scala-version -Mill allows you to specify the exact scala-library version you want to use for your build -via a `mill-scala-library-version` key in the build header: +Mill allows you to specify the Scala version you want to use for your build +via a `mill-scala-version` key in the build header: _build.mill_ [source] ---- -//| mill-scala-library-version: 3.7.2-RC1 +//| mill-scala-version: 3.7.2-RC1 ---- -This allows you to use newer versions of the scala-library than the version used by Mill +This allows you to use newer versions of Scala than the version used by Mill itself, as long as the version you use is backwards compatible. -If `mill-scala-library-version` is not provided, Mill uses the version of scala-library +If `mill-scala-version` is not provided, Mill uses the version of Scala used by Mill itself.