File tree Expand file tree Collapse file tree 2 files changed +26
-9
lines changed Expand file tree Collapse file tree 2 files changed +26
-9
lines changed Original file line number Diff line number Diff line change @@ -290,3 +290,18 @@ it accordingly before committing:
290
290
For more info about reflection configuration in GraalVM,
291
291
check [ the relevant GraalVM Reflection docs] ( https://www.graalvm.org/latest/reference-manual/native-image/dynamic-features/Reflection/ ) .
292
292
293
+ ## Overriding Scala versions in Scala CLI builds
294
+
295
+ It's possible to override the internal Scala version used to build Scala CLI,
296
+ as well as the default version used by the CLI itself with Java props.
297
+ - ` scala.version.internal ` - overrides the internal Scala version used to build Scala CLI
298
+ - ` scala.version.user ` - overrides the default Scala version used by the CLI itself
299
+
300
+ NOTE: remember to run ` ./mill clean ` to make sure the Scala versions aren't being cached anywhere.
301
+
302
+ ``` bash
303
+ ./mill -i clean
304
+ ./mill -i --define scala.version.internal=3.4.0-RC1-bin-20231012-242ba21-NIGHTLY --define scala.version.user=3.4.0-RC1-bin-20231012-242ba21-NIGHTLY scala version --offline
305
+ # Scala CLI version: 1.x.x-SNAPSHOT
306
+ # Scala version (default): 3.4.0-RC1-bin-20231012-242ba21-NIGHTLY
307
+ ```
Original file line number Diff line number Diff line change @@ -9,9 +9,17 @@ object Scala {
9
9
def scala213 = " 2.13.12"
10
10
def runnerScala3 = " 3.0.2" // the newest version that is compatible with all Scala 3.x versions
11
11
def scala3 = " 3.3.1"
12
- val allScala2 = Seq (scala213, scala212)
13
- val all = allScala2 ++ Seq (scala3)
14
- val mainVersions = Seq (scala3, scala213)
12
+
13
+ // The Scala version used to build the CLI itself.
14
+ def defaultInternal = sys.props.get(" scala.version.internal" ).getOrElse(scala3)
15
+
16
+ // The Scala version used by default to compile user input.
17
+ def defaultUser = sys.props.get(" scala.version.user" ).getOrElse(scala3)
18
+
19
+ val allScala2 = Seq (scala213, scala212)
20
+ val defaults = Seq (defaultInternal, defaultUser).distinct
21
+ val all = (allScala2 ++ Seq (scala3) ++ defaults).distinct
22
+ val mainVersions = (Seq (scala3, scala213) ++ defaults).distinct
15
23
val runnerScalaVersions = runnerScala3 +: allScala2
16
24
17
25
def scalaJs = " 1.13.2"
@@ -54,12 +62,6 @@ object Scala {
54
62
true
55
63
}
56
64
}
57
-
58
- // The Scala version used to build the CLI itself.
59
- def defaultInternal = scala3
60
-
61
- // The Scala version used by default to compile user input.
62
- def defaultUser = scala3
63
65
}
64
66
65
67
// Dependencies used in integration test fixtures
You can’t perform that action at this time.
0 commit comments