Skip to content

Commit 37207d5

Browse files
committed
Change the scala compiler version, not scala library version.
1 parent 62989aa commit 37207d5

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

runner/launcher/src/mill/launcher/CoursierClient.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ object CoursierClient {
1515
/**
1616
* Resolves the classpath for the mill daemon.
1717
*
18-
* @param scalaLibraryVersion the version of the scala library to use. If not specified, the version from the
19-
* mill build is used.
18+
* @param scalaVersion the version of the Scala to use. If not specified, the version that mill uses itself will be
19+
* used.
2020
*/
21-
def resolveMillDaemon(scalaLibraryVersion: Option[String]): Array[String] = {
21+
def resolveMillDaemon(scalaVersion: Option[String]): Array[String] = {
2222
val repositories = Await.result(Resolve().finalRepositories.future(), Duration.Inf)
2323
val coursierCache0 = FileCache[Task]()
2424
.withLogger(coursier.cache.loggers.RefreshLogger.create())
@@ -31,9 +31,9 @@ object CoursierClient {
3131
Module(Organization("com.lihaoyi"), ModuleName("mill-runner-daemon_3"), attributes = Map.empty),
3232
VersionConstraint(mill.client.BuildInfo.millVersion)
3333
)
34-
) ++ scalaLibraryVersion.map { version =>
34+
) ++ scalaVersion.map { version =>
3535
Dependency(
36-
Module(Organization("org.scala-lang"), ModuleName("scala3-library_3"), attributes = Map.empty),
36+
Module(Organization("org.scala-lang"), ModuleName("scala3-compiler_3"), attributes = Map.empty),
3737
VersionConstraint(version)
3838
)
3939
})

runner/launcher/src/mill/launcher/MillProcessLauncher.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ static String millJvmVersion() throws Exception {
156156
return loadMillConfigSingleValue("mill-jvm-version");
157157
}
158158

159-
static String millScalaLibraryVersion() throws Exception {
160-
return loadMillConfigSingleValue("mill-scala-library-version");
159+
static String millScalaVersion() throws Exception {
160+
return loadMillConfigSingleValue("mill-scala-version");
161161
}
162162

163163
static String loadMillConfigSingleValue(String key) throws Exception {
@@ -237,15 +237,15 @@ static List<String> millLaunchJvmCommand() throws Exception {
237237
// extra opts
238238
vmOptions.addAll(millJvmOpts());
239239

240-
var maybeScalaLibraryVersion = millScalaLibraryVersion();
240+
var maybeScalaVersion = millScalaVersion();
241241
vmOptions.add("-XX:+HeapDumpOnOutOfMemoryError");
242242
vmOptions.add("-cp");
243243
var classPathCacheKey =
244244
"mill:" + BuildInfo.millVersion +
245-
",scala-library-version:" + (maybeScalaLibraryVersion == null ? "default" : maybeScalaLibraryVersion);
245+
",scala:" + (maybeScalaVersion == null ? "default" : maybeScalaVersion);
246246
String[] runnerClasspath = cachedComputedValue0(
247247
"resolve-runner", classPathCacheKey,
248-
() -> CoursierClient.resolveMillDaemon(Option$.MODULE$.apply(maybeScalaLibraryVersion)),
248+
() -> CoursierClient.resolveMillDaemon(Option$.MODULE$.apply(maybeScalaVersion)),
249249
arr -> {
250250
for (String s : arr) {
251251
if (!Files.exists(Paths.get(s))) return false;

0 commit comments

Comments
 (0)