Releases: VirtusLab/scala-cli
v1.4.3
This release is a hotfix for 1.4.2, which due to technical difficulties was not released to Maven Central (and, as an extension, wasn't available as a JAR).
All changes introduced by v1.4.2 are included in this release.
Internal changes
- Ensure the
publish
step to be necessary for updating the native packages upon release by @Gedochao in #3067
Updates
- Update mill-main to 0.11.10 by @scala-steward in #3060
- Update mill-main to 0.11.11 by @Gedochao in #3068
Full Changelog: v1.4.2...v1.4.3
v1.4.2
Environment variable help with --env-help
You can now list environment variables used internally with the --envs-help
flag.
This does include some environment variable used by Scala CLI's dependencies (like Coursier, Bloop, etc.), but should not be treated as an exhaustive list.
scala-cli --env-help --power
# The following is the list of environment variables used and recognized by Scala CLI.
# It should by no means be treated as an exhaustive list.
# Some tools and libraries Scala CLI integrates with may have their own, which may or may not be listed here.
#
# Scala CLI
# SCALA_CLI_CONFIG Scala CLI configuration file path
# SCALA_CLI_HOME Scala CLI home directory
# SCALA_CLI_INTERACTIVE Interactive mode toggle
# SCALA_CLI_INTERACTIVE_INPUTS Interactive mode inputs
# SCALA_CLI_POWER Power mode toggle
# SCALA_CLI_PRINT_STACK_TRACES Print stack traces toggle
# SCALA_CLI_SODIUM_JNI_ALLOW Allow to load libsodiumjni
# SCALA_CLI_VENDORED_ZIS Toggle io.github.scala_cli.zip.ZipInputStream
#
# Java
# JAVA_HOME Java installation directory
# JAVA_OPTS Java options
# JDK_JAVA_OPTIONS JDK Java options
#
# Coursier
# COURSIER_CACHE Coursier cache location
# COURSIER_MODE Coursier mode (can be set to 'offline')
#
# Spark
# SPARK_HOME (power) Spark installation directory
#
# Miscellaneous
# PATH The app path variable
# DYLD_LIBRARY_PATH Runtime library paths on Mac OS X
# LD_LIBRARY_PATH Runtime library paths on Linux
# PATHEXT Executable file extensions on Windows
# SHELL The currently used shell
# VCVARSALL Visual C++ Redistributable Runtimes
# ZDOTDIR Zsh configuration directory
#
# Internal
# CI (power) Marker for running on the CI
Features
- Add environment variable help under
--envs-help
& refactor environment variable usage by @Gedochao in #3055
Fixes
- Fix default scaladoc config, so that id doesn't break all scaladoc links by @KacperFKorban in #3041
- Fix the REPL crashing when a dependency's classpath is called by a macro by @Gedochao in #3043
- Fix Mill export for projects with just the test scope by @Gedochao in #3046
- Ensure
--cli-default-scala-version
is respected by--scalac-help
by @Gedochao in #3048 - Fix
generate-linux-arm64-native-launcher
by @Gedochao in #3053
Internal changes
- Prevent some flaky tests from failing on the CI by @Gedochao in #3049
- Switch to GitHub M1/
aarch64
runners on the CI by @Gedochao in #3050 - Fix Scala 2 nightly test failures by tagging them as flaky or skipping by @Gedochao in #3064
Updates
- Update scala-cli.sh launcher for 1.4.1 by @github-actions in #3039
- Update ammonite to 3.0.0-M2-15-9bed9700 by @scala-steward in #3059
- Update metaconfig-typesafe-config to 0.13.0 by @scala-steward in #3058
- Update semanticdb-shared_2.13.14 to 4.9.9 by @scala-steward in #3063
- Update scalafmt-cli_2.13, scalafmt-core to 3.8.3 by @scala-steward in #3062
- Update os-lib to 0.10.3 by @scala-steward in #3061
Full Changelog: v1.4.1...v1.4.2
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
v1.4.0
Running the REPL with the test scope included
It is now possible to start the Scala REPL with access to the test scope.
To do so, it's enough to pass the --test
flag with the repl
sub-command.
package example
object ReplTestScopeExample {
def message: String = "calling test scope from repl"
}
scala-cli repl ReplTestScopeExample.test.scala --test
# Compiling project (test, Scala 3.4.2, JVM (17))
# Compiled project (test, Scala 3.4.2, JVM (17))
# Welcome to Scala 3.4.2 (17, Java OpenJDK 64-Bit Server VM).
# Type in expressions for evaluation. Or try :help.
#
# scala> example.ReplTestScopeExample.message
# val res0: String = calling test scope from repl
#
# scala>
The using jvm
directives are now always respected
Formerly, if the build server (Bloop) was running on an older JVM than the one specified in a using jvm
directive, the directive wouldn't be respected. We now restart the build server based on both the directive and the respective command line option (--jvm
).
//> using jvm 22
//> using javacOpt --enable-preview -Xlint:preview
//> using javaOpt --enable-preview
//> using mainClass Simple
void main() {
System.out.println("Hello from Java 22");
}
Added by @kasiaMarek in #2972
Support for Scala Native 0.5.4
This Scala CLI version adds support for Scala Native 0.5.4.
Native platform builds will now use 0.5.4 as the default version.
scala-cli -e 'println("Hello, Scala Native!")' --native
# Compiling project (Scala 3.4.2, Scala Native 0.5.4)
# Compiled project (Scala 3.4.2, Scala Native 0.5.4)
# [info] Linking (multithreadingEnabled=true, disable if not used) (902 ms)
# [info] Discovered 882 classes and 5384 methods after classloading
# [info] Checking intermediate code (quick) (37 ms)
# [info] Multithreading was not explicitly enabled - initial class loading has not detected any usage of system threads. Multithreading support will be disabled to improve performance.
# [info] Linking (multithreadingEnabled=false) (292 ms)
# [info] Discovered 499 classes and 2497 methods after classloading
# [info] Checking intermediate code (quick) (10 ms)
# [info] Discovered 478 classes and 1912 methods after optimization
# [info] Optimizing (debug mode) (445 ms)
# [info] Produced 9 LLVM IR files
# [info] Generating intermediate code (353 ms)
# [info] Compiling to native code (1619 ms)
# [info] Linking with [pthread, dl]
# [info] Linking native code (immix gc, none lto) (137 ms)
# [info] Postprocessing (0 ms)
# [info] Total (3753 ms)
# Hello, Scala Native!
Added by @scala-steward in #2982.
Scala Toolkit 0.4.0 & 0.3.0 defaults
This Scala CLI version treats Scala Toolkit 0.4.0 as the default version under most circumstances.
//> using toolkit default
@main def main() = println(os.pwd)
This unlocks the Scala Toolkit to be used with Scala Native 0.5.x.
scala-cli -e 'println(os.pwd)' --toolkit default --native
# Compiling project (Scala 3.4.2, Scala Native 0.5.4)
# Compiled project (Scala 3.4.2, Scala Native 0.5.4)
# [info] Linking (multithreadingEnabled=true, disable if not used) (1051 ms)
# [info] Discovered 1047 classes and 6745 methods after classloading
# [info] Checking intermediate code (quick) (46 ms)
# [info] Multithreading was not explicitly enabled - initial class loading has not detected any usage of system threads. Multithreading support will be disabled to improve performance.
# [info] Linking (multithreadingEnabled=false) (543 ms)
# [info] Discovered 880 classes and 5417 methods after classloading
# [info] Checking intermediate code (quick) (15 ms)
# [info] Discovered 857 classes and 4238 methods after optimization
# [info] Optimizing (debug mode) (651 ms)
# [info] Produced 9 LLVM IR files
# [info] Generating intermediate code (663 ms)
# [info] Compiling to native code (1621 ms)
# [info] Linking with [pthread, dl]
# [info] Linking native code (immix gc, none lto) (81 ms)
# [info] Postprocessing (0 ms)
# [info] Total (4542 ms)
Scala Native 0.4.x has been dropped in Scala Toolkit 0.4.0 and above, so the last version supporting it, 0.3.0 (and lower), will now make the build default to Scala Native 0.4.17.
scala-cli -e 'println(os.pwd)' --toolkit 0.3.0 --native
# [warn] Scala Toolkit Version(0.3.0) does not support Scala Native 0.5.3, 0.4.17 should be used instead.
# [warn] Scala Native default version 0.5.3 is not supported in this build. Using 0.4.17 instead.
# Compiling project (Scala 3.4.2, Scala Native 0.4.17)
# Compiled project (Scala 3.4.2, Scala Native 0.4.17)
# [info] Linking (900 ms)
# [info] Checking intermediate code (quick) (63 ms)
# [info] Discovered 888 classes and 5298 methods
# [info] Optimizing (debug mode) (836 ms)
# [info] Generating intermediate code (620 ms)
# [info] Produced 10 files
# [info] Compiling to native code (1860 ms)
# [info] Linking with [pthread, dl]
# [info] Total (4406 ms)
# ~/scala-cli-tests
The troublesome case is when Scala Native 0.4.x is passed explicitly, while the Scala Toolkit is set to the default.
Scala CLI does not currently support downgrading the Scala Toolkit in this case, and fails the build.
scala-cli -e 'println(os.pwd)' --toolkit default --native --native-version 0.4.17
# Downloading 4 dependencies and 2 internal dependencies
# [error] Error downloading org.scala-lang:toolkit-test_native0.4_3:0.4.0
# [error] not found: ~/.ivy2/local/org.scala-lang/toolkit-test_native0.4_3/0.4.0/ivys/ivy.xml
# [error] not found: https://repo1.maven.org/maven2/org/scala-lang/toolkit-test_native0.4_3/0.4.0/toolkit-test_native0.4_3-0.4.0.pom
# [error] not found: ~/Library/Caches/ScalaCli/local-repo/1.4.0/org.scala-lang/toolkit-test_native0.4_3/0.4.0/ivys/ivy.xml
# [error] No fallback URL found
# [error] COMMAND_LINE
# [error] Error downloading org.scala-lang:toolkit_native0.4_3:0.4.0
# [error] not found: ~/.ivy2/local/org.scala-lang/toolkit_native0.4_3/0.4.0/ivys/ivy.xml
# [error] not found: https://repo1.maven.org/maven2/org/scala-lang/toolkit_native0.4_3/0.4.0/toolkit_native0.4_3-0.4.0.pom
# [error] not found: ~/Library/Caches/ScalaCli/local-repo/1.4.0/org.scala-lang/toolkit_native0.4_3/0.4.0/ivys/ivy.xml
# [error] No fallback URL found
# [error] COMMAND_LINE
Features
Fixes
- Fix BSP IllegalArgumentException when loading project in Metals by @joan38 in #2950
- Don't check for newer CLI versions when the
--cli-version
launcher param is passed (v1.4.0 and onwards, only) by @Gedochao in #2957 - fix: start bloop with jvm version from using directives for JVMs > 17 by @kasiaMarek in #2972
Documentation changes
- Typo fixed in scripts.md by @vaivanov95 in #2974
Internal changes
Updates
- Update scala-cli.sh launcher for 1.3.2 by @github-actions in #2938
- Update guava to 33.2.1-jre by @scala-steward in #2947
- Update os-lib to 0.10.2 by @scala-steward in #2949
- Update ammonite to 3.0.0-M2-8-ba4429a2 by @scala-steward in #2948
- Update case-app to 2.1.0-M28 by @scala-steward in #2956
- Update Scala Toolkit to 0.4.0 & dynamically adjust Scala Native defaults by @Gedochao in #2955
- Update munit to 1.0.0 by @scala-steward in #2935
- Update ammonite to 3.0.0-M2-9-88291dd8 by @scala-steward in #2960
- Update
scalameta
to 4.9.6 by @scala-steward in #2967 - Update ammonite to 3.0.0-M2-10-f6e2c001 by @scala-steward in #2965
- Update scalafmt-cli_2.13, scalafmt-core to 3.8.2 by @scala-steward in #2966
- Update scalameta to 4.9.7 by @scala-steward in #2983
- Pin
scala-cli-setup
to v1 and update CI scripts' dependencies by @Gedochao in #2984 - Update Scala Native to 0.5.4 by @scala-steward in #2982
- Update mill-main to 0.11.8 by @scala-steward in #2980
- Update bloop-config_2.13 to 2.0.2 by @scala-steward in #2978
- Update ammonite to 3.0.0-M2-12-951bbc1e by @scala-steward in #2979
New Contributors
- @vaivanov95 made their first contribution in #2974
Full Changelog: v1.3.2...v1.4.0
v1.3.2
Support for Scala 3.4.2
This Scala CLI version adds support for Scala 3.4.2.
scala-cli version
# Scala CLI version: 1.3.2
# Scala version (default): 3.4.2
Incremental Scala.js linking
Scala CLI now can take advantage of Scala.js' powerful incremental linker, which makes linking very fast for multiple links in a row. For Scala.js builds, the scala-js-cli
process is now run with the newly added --longRunning
mode. The process is then reused if the inputs did not change.
Added by @lolgab in #2928 and VirtusLab/scala-js-cli#64
Features
- Support ARM64 architecture to the launcher script for Mac OS by @carlosedp in #2895
- Incremental Scala.js Linking by @lolgab in #2928
Fixes
- Fix support of multiline shebang by @sierikov in #2908
- Pass scala2-sbt-bridge to Bloop explicitly for Scala 2.13.12+ by @Gedochao in #2927
- Ensure
JAVA_HOME
ofsetup-ide
is respected bybsp
by @Gedochao in #2920 - Improve launcher options handling by @Gedochao in #2931
Documentation changes
- Add docs for
ignore
keyword in snippets in md by @sierikov in #2898 - Back port of documentation changes to main by @github-actions in #2900
- Back port of documentation changes to main by @github-actions in #2910
- Add Scalafmt Cookbook by @sierikov in #2903
- Back port of documentation changes to main by @github-actions in #2914
- remove duplicated word by @naferx in #2915
- Remove unused imports by @naferx in #2916
- corrected instructions for downloading the launcher in Windows (fixes #2921) by @philwalk in #2922
Internal changes
Updates
- Update scala-cli.sh launcher for 1.3.1 by @github-actions in #2894
- Update ammonite to 3.0.0-M1-24-26133e66 by @scala-steward in #2896
- Update ammonite to 3.0.0-M2-1-3763a1d4 by @scala-steward in #2905
- Update scalameta to 4.9.4 by @scala-steward in #2906
- Update Scala Next to 3.4.2 by @Gedochao in #2911
- Update ammonite to 3.0.0-M2-2-741e5dbb by @scala-steward in #2913
- Update os-lib to 0.10.1 by @scala-steward in #2918
- Update
scalameta
to 4.9.5 by @scala-steward in #2919 - Update ammonite to 3.0.0-M2-3-b5eb4787 by @scala-steward in #2917
- Update Scala Next RC to 3.5.0-RC1 by @Gedochao in #2912
- Update bloop-rifle_2.13 to 1.5.17-sc-2 by @scala-steward in #2925
- Update sttp core_2.13 to 3.9.7 by @scala-steward in #2924
- Update ammonite to 3.0.0-M2-4-c3312916 by @scala-steward in #2923
- Bump
scala-js-cli
to v1.16.0.1 by @Gedochao in #2929
New Contributors
Full Changelog: v1.3.1...v1.3.2
v1.3.1
Scala 2.13.14 support
This Scala CLI version adds support for Scala 2.13.14.
scala-cli -e 'println(scala.util.Properties.versionNumberString)' -S 2.13
# Compiling project (Scala 2.13.14, JVM (17))
# Compiled project (Scala 2.13.14, JVM (17))
# 2.13.14
Fixes
- Adjust TASTY bump warnings to respect overridden Scala version defaults by @Gedochao in #2888
- Include
scala3-staging
andscala3-tasty-inspector
artifacts when the--with-compiler
option is passed in Scala 3 by @Gedochao in #2889
Internal changes
Updates
- Update scala-cli.sh launcher for 1.3.0 by @github-actions in #2876
- Update Scala 2 to 2.13.14 by @Gedochao in #2882
- Update guava to 33.2.0-jre by @scala-steward in #2883
- Update
com.softwaremill.sttp.client3:core
to 3.9.6 by @scala-steward in #2885 - Update sbt to 1.10.0 by @scala-steward in #2887
- Update ammonite to 3.0.0-M1-19-a7973e17 by @scala-steward in #2884
- Bump
coursier
to 2.1.10 by @Gedochao in #2890
Full Changelog: v1.3.0...v1.3.1
v1.3.0
Support for Scala Native 0.5.1
This Scala CLI version adds support for Scala Native 0.5.1. All native platform builds will now use 0.5.1 as the default version.
scala-cli -e 'println("Hello, Scala Native!")' --native
# Compiling project (Scala 3.4.1, Scala Native 0.5.1)
# Compiled project (Scala 3.4.1, Scala Native 0.5.1)
# [info] Linking (multithreadingEnabled=true, disable if not used) (1059 ms)
# [info] Discovered 882 classes and 5388 methods after classloading
# [info] Checking intermediate code (quick) (39 ms)
# [info] Multithreading was not explicitly enabled - initial class loading has not detected any usage of system threads. Multithreading support will be disabled to improve performance.
# [info] Linking (multithreadingEnabled=false) (291 ms)
# [info] Discovered 499 classes and 2501 methods after classloading
# [info] Checking intermediate code (quick) (6 ms)
# [info] Discovered 478 classes and 1916 methods after optimization
# [info] Optimizing (debug mode) (432 ms)
# [info] Produced 9 LLVM IR files
# [info] Generating intermediate code (293 ms)
# [info] Compiling to native code (1504 ms)
# [info] Linking with [pthread, dl]
# [info] Linking native code (immix gc, none lto) (351 ms)
# [info] Postprocessing (0 ms)
# [info] Total (4012 ms)
# Hello, Scala Native!
Note that not all the tools Scala CLI integrates with support Scala Native 0.5.x just yet.
When such an integration is being used, the default Scala Native version will get downgraded to 0.4.17.
scala-cli -e 'println("Hello, Scala Native!")' --native --toolkit default
# [warn] Scala Toolkit does not support Scala Native 0.5.1, 0.4.17 should be used instead.
# [warn] Scala Native default version 0.5.1 is not supported in this build. Using 0.4.17 instead.
# Compiling project (Scala 3.4.1, Scala Native 0.4.17)
# Compiled project (Scala 3.4.1, Scala Native 0.4.17)
# [info] Linking (1017 ms)
# [info] Checking intermediate code (quick) (53 ms)
# [info] Discovered 743 classes and 4242 methods
# [info] Optimizing (debug mode) (654 ms)
# [info] Generating intermediate code (898 ms)
# [info] Produced 10 files
# [info] Compiling to native code (2039 ms)
# [info] Linking with [pthread, dl]
# [info] Total (4812 ms)
# Hello, Scala Native!
Efforts for supporting Scala Native 0.5.x are ongoing, we expect the downgrade to 0.4.17 in such cases to be a temporary solution.
If you know for a fact that 0.5.x support has been delivered for a tool, you can always pass the --native-version
option explicitly, which will prevent the downgrade.
Fixes
- Add missing Scala 2 compiler print options by @Gedochao in #2848
- Don't recommend
latest
for toolkit version by @keynmol in #2852 - Explicitly pass
scala3-sbt-bridge
to Bloop by @Gedochao in #2873
Internal changes
Updates and maintenance
- Update scala-cli.sh launcher for 1.2.2 by @github-actions in #2847
- Update os-lib to 0.10.0 by @scala-steward in #2854
- Update scala-collection-compat to 2.12.0 by @scala-steward in #2856
- Update slf4j-nop to 2.0.13 by @scala-steward in #2857
- Update pprint to 0.9.0 by @scala-steward in #2855
- Update fansi to 0.5.0 by @scala-steward in #2853
- Update using_directives to 1.1.1 by @scala-steward in #2863
- Update Scala Native to 0.5.1 by @scala-steward and @Gedochao in #2862
- Update
bloop-core
to 1.5.17-sc-1 by @scala-steward in #2873 - Update
bloop-config
to 2.0.0 by @scala-steward in #2873
Full Changelog: v1.2.2...v1.3.0
v1.2.2
Fixed the Fatal invariant violated
false-positive error coming from Bloop
This small update fixes the Fatal invariant violated
error (#2829) that was being thrown by Bloop when running Scala CLI repeatedly with the same sources.
Fixed by @Gedochao & @tgodzik in #2837
Enhancements
Updates and maintenance
- Update scala-cli.sh launcher for 1.2.1 by @github-actions in #2828
- Update
org.scalameta:trees_2.13
to 4.9.3 by @scala-steward in #2831 - Update ammonite to 3.0.0-M1-10-105f9e32 by @scala-steward in #2844
- Bump
bloop-core
to 1.5.16-sc-2 by @Gedochao in #2837
What's Changed
Full Changelog: v1.2.1...v1.2.2
v1.2.1
Support for Scala 3.4.1
This Scala CLI version adds support for Scala 3.4.1.
scala-cli version
# Scala CLI version: 1.2.1
# Scala version (default): 3.4.1
Additionally, from this version on Scala CLi is being tested against the latest Scala 3 Next RC.
And so, feel free to try out Scala 3.4.2-RC1!
scala-cli run -S 3.4.2-RC1 --with-compiler -e 'println(dotty.tools.dotc.config.Properties.simpleVersionString)'
# Compiling project (Scala 3.4.2-RC1, JVM (17))
# Compiled project (Scala 3.4.2-RC1, JVM (17))
# 3.4.2-RC1
Added by @Gedochao in #2824 & #2822
Support for Scala.js 1.16.0
This version adds Scala CLI support for Scala.js 1.16.0.
Added by @scala-steward in #2807 & @Gedochao in VirtusLab/scala-js-cli#55.
Fixes
- Fix handling for
-Xlint:help
by @Gedochao in #2781 - Fix
--semanticdb-targetroot
&--semanticdb-sourceroot
for scripts by @Gedochao in #2784 - Adjust actionable diagnostics for scripts by @rochala in #2815
- Fix publishing of runner & test-runner artifacts by @Gedochao in #2819
- bugfix: Fix Bloop import by @tgodzik in #2825
Enhancements
Internal changes
Documentation changes
- Add installation guide for FreeBSD by @spacebanana420 in #2793
- Back port of documentation changes to main by @github-actions in #2797
Updates and maintenance
- Update scala-cli.sh launcher for 1.2.0 by @github-actions in #2783
- Update core_2.13 to 3.9.4 by @scala-steward in #2787
- Update ammonite to 3.0.0-M1-8-35694880 by @scala-steward in #2786
- Update trees_2.13 to 4.9.2 by @scala-steward in #2795
- Update guava to 33.1.0-jre by @scala-steward in #2801
- Bump follow-redirects from 1.15.4 to 1.15.6 in /website by @dependabot in #2803
- Add -unchecked to the list of options that don't require -O by @joan38 in #2800
- Update bloop-rifle_2.13 to 1.5.12-sc-1 by @scala-steward in #2806
- Update sttp.client core to 3.9.5 by @scala-steward in #2810
- Update asm to 9.7 by @scala-steward in #2813
- Update Scala.js to 1.16.0 by @scala-steward in #2807
- Bump express from 4.18.2 to 4.19.2 in /website by @dependabot in #2816
- Update Bloop to 1.5.16-sc-1 by @Gedochao in #2818
- Bump Scala Next to 3.4.1 by @Gedochao in #2822
- Bump Typelevel Toolkit to 0.1.23 by @Gedochao in #2823
New Contributors
Full Changelog: v1.2.0...v1.2.1
v1.2.0
Scala 3.3.3, 3.4.0, 2.13.13 & 2.12.19 support
This version of Scala CLI adds support for a whooping 4 new Scala versions, it's been busy these past few days!
The default version used when using the CLI will from now on be the Scala 3 Next version (3.4.0 as of this release).
Using the lts
tag will now point to Scala 3.3.3.
The LTS is also the version used for building the internals of Scala CLI (although we now also cross-compile with 3.4.0).
scala-cli version
# Scala CLI version: 1.2.0
# Scala version (default): 3.4.0
Added by @Gedochao in #2772, #2736, #2755, #2753 and #2752
Remapping EsModule imports at link time with Scala.js
Given the following importMap.json
file:
{
"imports": {
"@stdlib/linspace": "https://cdn.skypack.dev/@stdlib/linspace"
}
}
It is now possible to remap the imports at link time with the jsEsModuleImportMap
directive.
//> using jsEsModuleImportMap importMap.json
//> using jsModuleKind es
//> using jsMode fastLinkJS
//> using platform js
import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport
import scala.scalajs.js.typedarray.Float64Array
object Foo {
def main(args: Array[String]): Unit = {
println(Array(-10.0, 10.0, 10).mkString(", "))
println(linspace(0, 10, 10).mkString(", "))
}
}
@js.native
@JSImport("@stdlib/linspace", JSImport.Default)
object linspace extends js.Object {
def apply(start: Double, stop: Double, num: Int): Float64Array = js.native
}
The same can be achieved with the --js-es-module-import-map
command line option.
scala-cli --power package RemappingEsModuleImports.scala --js --js-module-kind ESModule -o main.js --js-es-module-import-map importMap.json
Added by @Quafadas in #2737 and VirtusLab/scala-js-cli#47
Fixes
- Updated method for choosing a free drive letter (fixes #2743) by @philwalk in #2749
- Make sure tasty-lib doesn't warn about Scala 3 Next by @Gedochao in #2775
Enhancements
Internal changes
- Fix overeager Scala version docs tests by @Gedochao in #2750
- Lock script wrapper tests on the internally used Scala 2.13 version by @Gedochao in #2754
- Use Scala LTS as the default version while cross compiling all Scala 3 modules on both LTS & Next by @Gedochao in #2752
- Explicitly set sonatype publishing to use the default cross Scala version by @Gedochao in #2757
- Fix publishing of artifacts to include non-cross-compiled modules by @Gedochao in #2759
- Run integration tests with both Scala 3 LTS & Next versions by @Gedochao in #2760
Documentation changes
- Fix typo by @imRentable in #2739
- Add directive examples in Scala Native docs by @spamegg1 in #2774
- toolkit latest is deprecated, mention default instead by @spamegg1 in #2776
Updates and maintenance
- Update scala-cli.sh launcher for 1.1.3 by @github-actions in #2734
- Bump webfactory/ssh-agent from 0.8.0 to 0.9.0 by @dependabot in #2731
- Update
coursier
to 2.1.9 by @Gedochao in #2735 - Bump
scala-js-cli
to 1.15.0.1 by @Gedochao in #2738 - Update Scala to 3.4.0 by @Gedochao in #2736
- Update slf4j-nop to 2.0.12 by @scala-steward in #2748
- Update trees_2.13 to 4.9.0 by @scala-steward in #2747
- Update mill-main to 0.11.7 by @scala-steward in #2744
- Update sttp client core_2.13 to 3.9.3 by @scala-steward in #2745
- Bump Scala 2.12 to 2.12.19 by @Gedochao in #2753
- Update sbt to 1.9.9 by @scala-steward in #2756
- Bump Scala 2.13 to 2.13.13 by @Gedochao in #2755
- Update scalameta to 4.9.1 by @scala-steward in #2770
- Bump Scala LTS to 3.3.3 by @Gedochao in #2772
- Update ammonite to 3.0.0-M0-71-1e75159e by @scala-steward in #2773
- Update ammonite to 3.0.0-M0-92-0b2ae1a1 by @scala-steward in #2782
New Contributors
- @imRentable made their first contribution in #2739
- @spamegg1 made their first contribution in #2774
Full Changelog: v1.1.3...v1.2.0