v1.4.1
Pass compiler args as an @argument
file
You can shorten or simplify a Scala CLI command by using an @argument
file to specify a text file that contains compiler arguments.
-d
outputDirectory
The feature may help to work around the Windows command line character limit, among other things, making sure your scripts run on any operating system of your choice.
scala-cli run -e 'println("Hey, I am using an @args file!")' @args.txt
This works similarly to the command-line argument files feature of Java 9 and fixes backwards compatibility with the old scala
runner (pre-Scala-3.5.0).
Added by @kasiaMarek in #3012
Explicitly enable or disable multithreading in Scala Native
It is now possible to explicitly enable or disable multithreading in Scala Native builds.
You can do it by setting the //> using nativeMultithreading
directive:
//> using platform native
//> using nativeMultithreading
import scala.concurrent._
import scala.concurrent.duration._
import ExecutionContext.Implicits.global
val promise = Promise[Int]()
val thread = new Thread(new Runnable {
def run(): Unit = {
Thread.sleep(100)
promise.success(42)
}
})
thread.start()
val result = Await.result(promise.future, 2.seconds)
println(result)
Or the --native-multithreading
command line option:
scala-cli run native_multithreading.sc --native --native-multithreading
Features
- Add a command line option & directive for enabling/disabling Scala Native multithreading by @Gedochao in #3011
- feat: allow to pass scalac options using files by @kasiaMarek in #3012
Fixes
- fix for 2954 running script in root dir by @philwalk in #2988
- Pass
javaHome
to Bloop by @kasiaMarek in #2985 - bugfix: Print info diagnostics by @tgodzik in #2990
- Ensure BSP respects --power mode by @Gedochao in #2997
- Add Scala to pure Java test builds by @Gedochao in #3009
- Fix --offline mode for scala-cli as scala installation via coursier by @Gedochao in #3029
- BugFix - Export issues when full scala version is not used in directives by @yadavan88 in #3032
Documentation changes
- Fix typo in docs by @ghostdogpr in #2996
- docs: remove
.
from command snippet by @spaceunifyfifty in #2998
Updates
- Update scala-cli.sh launcher for 1.4.0 by @github-actions in #2992
- Update winget-releaser to latest by @vedantmgoyal9 in #2991
- Update ammonite to 3.0.0-M2-13-23a8ef64 by @scala-steward in #2989
- Update Scala 3 Next RC to 3.5.0-RC2 by @scala-steward in #2981
- chore: Bump outdated
javac-semanticdb
plugin to 0.10.0 by @tgodzik in #3004 - Update Scala 3 Next RC to 3.5.0-RC3 by @scala-steward in #3002
- Update sbt to 1.10.1 by @scala-steward in #3015
- Bump Scala 3 Next RC to 3.5.0-RC4 by @Gedochao in #3018
- Swap
scalameta
trees
forsemanticdb-shared
& bumpscalameta
to 4.9.8 by @Gedochao in #3017 - Update Scala 3 Next RC to 3.5.1-RC1 by @scala-steward in #3027
New Contributors
- @vedantmgoyal9 made their first contribution in #2991
- @ghostdogpr made their first contribution in #2996
- @spaceunifyfifty made their first contribution in #2998
Full Changelog: v1.4.0...v1.4.1