Releases: VirtusLab/scala-cli
v1.8.0
Support for Scala 3.7.0 and 3.3.6
This Scala CLI version switches the default Scala version to 3.7.0.
The CLI internals are now built with Scala 3.3.6.
scala-cli version
# Scala CLI version: 1.8.0
# Scala version (default): 3.7.0
Support for Scala.js 1.19.0
This Scala CLI version adds support for Scala.js 1.19.0.
scala-cli -e 'println("Hello")' --js
# Compiling project (Scala 3.7.0, Scala.js 1.19.0)
# Compiled project (Scala 3.7.0, Scala.js 1.19.0)
# Hello
Added in #3643 and VirtusLab/scala-js-cli#134
Drop support for Scala <3.3 in runner
and test-runner
modules
Starting with Scala CLI v1.8.0, the runner
and test-runner
modules are built with Scala 3.3.6 LTS (on par with other modules built with Scala 3). They used to be built with Scala 3.0.2, as those modules may get added to the project class path when running, respectively, the main scope and tests. This means that if the application is using pre-3.3 Scala 3, TASTy versions will be incompatible.
This is mostly informative, as the change should not be breaking for standard Scala CLI usage, even if an older Scala 3 version is being used. For builds using Scala <3.3, the CLI will automatically fall back to version 1.7.1 of the modules, with an appropriate warning being printed. As the fallback will not be updated in the future, some Scala CLI features might start breaking at some point, as the APIs will stop being fully in sync.
scala-cli -e 'println("Hello")' --runner -S 3.1
# [warn] Scala 3.1.3 is no longer supported by the runner module.
# [warn] Defaulting to a legacy runner module version: 1.7.1.
# [warn] To use the latest runner, upgrade Scala to at least Scala 3.3.
# Compiling project (Scala 3.1.3, JVM (17))
# Compiled project (Scala 3.1.3, JVM (17))
# Hello
scala-cli test . -S 3.2
# [warn] Scala 3.2.2 is no longer supported by the test-runner module.
# [warn] Defaulting to a legacy test-runner module version: 1.7.1.
# [warn] To use the latest test-runner, upgrade Scala to at least 3.3.
# Compiling project (test, Scala 3.2.2, JVM (17))
# Compiled project (test, Scala 3.2.2, JVM (17))
# Test run started
# Test MyTests.foo started
# Hello, world!
# Test MyTests.foo finished, took 0.001 sec
# Test run finished: 0 failed, 0 ignored, 1 total, 0.003s
Realistically, the change is only breaking for apps using those modules directly themselves, either depending on them or using them to run things. In either case, it is recommended to update Scala up to at least 3.3 LTS.
Scala CLI now detects and runs multiple test frameworks, rather than just one
When running tests in a project with multiple test frameworks in use, Scala CLI will now attempt to detect and run all of them, rather than just one.
scala-cli test .
# Compiling project (Scala 3.7.0, JVM (23))
# Compiled project (Scala 3.7.0, JVM (23))
# Compiling project (test, Scala 3.7.0, JVM (23))
# Compiled project (test, Scala 3.7.0, JVM (23))
# Munit:
# + foo 0.007s
# -------------------------------- Running Tests --------------------------------
# + MyTests.foo 1ms
# Tests: 1, Passed: 1, Failed: 0
# + SimpleSpec
# Hello from zio-test
# + print hello and assert true
# 1 tests passed. 0 tests failed. 0 tests ignored.
#
# Executed in 97 ms
#
# Completed tests
# ScalaTestSpec:
# example
# - should work
# Run completed in 44 milliseconds.
# Total number of tests run: 1
# Suites: completed 1, aborted 0
# Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0
# All tests passed.
Additionally, it is now possible to pre-define multiple test frameworks to use (rather than just one, as before).
//> using test.frameworks org.scalatest.tools.Framework munit.Framework custom.CustomFramework
Pre-defining test frameworks may be preferable for bigger projects, as it allows to skip framework detection and run them directly. This is significant particularly for running tests with Scala Native and Scala.js.
Features
- Support the
--test
flag with thepublish
&publish local
sub-commands by @Gedochao in #3538 - Misc no-op and/or error handling for the
--test
command line flag by @Gedochao in #3586 - Add scala-cli version to the BuildInfo by @yadavan88 in #3617
fix
sub-command tweaks by @Gedochao in #3646- Run all found test frameworks, rather than just one by @Gedochao in #3621
- Allow to preconfigure multiple test frameworks by @Gedochao in #3653
- Add support for some missing Scala compiler options & aliases without the need for
-O
by @Gedochao in #3665 - Add support for the --repl-quit-after-init REPL option by @Gedochao in #3664
Fixes
- Fix
fmt
to format theproject.scala
configuration file as any other Scala input by @Gedochao in #3609 - Apply
scalafix
rules to test scope inputs, too by @Gedochao in #3641
Internal and build changes
- Cross compile everything on the CI by @Gedochao in #3570
- Add tests for the current behaviour of
--cross
by @Gedochao in #3589 - Run
test
sub-command integration tests on default JVM settings by @Gedochao in #3592 - Retry docs' tests on the CI by @Gedochao in #3618
- Move
ScopeOptions
toSharedOptions
by @Gedochao in #3612 - Include missing Scala
3.6.*
versions inScala.listAll
by @Gedochao in #3652 - Check formatting with Scala CLI, rather than the
scalafmt
launcher itself by @Gedochao in #3660
Documentation changes
- compileOnly option added to the documentation by @yadavan88 in #3600
- Back port of documentation changes to main by @github-actions in #3601
- docs: guide for compile only deps by @scarf005 in #3602
- Back port of documentation changes to main by @github-actions in #3607
- Add missing
using
directive reference docs by @Gedochao in #3608 - Back port of documentation changes to main by @github-actions in #3610
- Fix formatting in directives' reference docs by @Gedochao in #3611
- Back port of documentation changes to main by @github-actions in #3616
- Fixed DEV.md file related to test command by @yadavan88 in #3619
- Correct doc with --project-version by @joan38 in #3662
Updates
- Bump webfactory/ssh-agent from 0.9.0 to 0.9.1 by @dependabot in #3576
- Bump react from 18.2.0 to 18.3.1 in /website by @dependabot in #3573
- Update scala-cli.sh launcher for 1.7.1 by @github-actions in #3579
- Update guava to 33.4.5-jre by @scala-steward in #3581
- Update bloop-rifle_2.13 to 2.0.9 by @scala-steward in #3580
- Update sbt, scripted-plugin to 1.10.11 by @scala-steward in #3582
- Pin & update docker images by @Gedochao in #3558
- Bump clsx from 1.2.1 to 2.1.1 in /website by @dependabot in #3560
- Bump
docusaurus
to 3.7.0 by @Gedochao in #3585 - Bump react-dom from 18.2.0 to 18.3.1 in /website by @dependabot in #3587
- Bump sass from 1.58.3 to 1.86.0 in /website by @dependabot in #3588
- Bump @easyops-cn/docusaurus-search-local from 0.49.1 to 0.49.2 in /website by @dependabot in #3604
- Update asm to 9.8 by @scala-steward in #3606
- Update guava to 33.4.6-jre by @scala-steward in #3605
- Bump sass from 1.86.0 to 1.86.1 in /website by @dependabot in #3603
- Bump @mdx-js/react from 3.0.0 to 3.1.0 in /website by @dependabot in #3575
- Bump sass from 1.86.1 to 1.86.3 in /website by @dependabot in #3622
- Bump estree-util-value-to-estree from 3.0.1 to 3.3.3 in /website by @dependabot in #3623
- Update guava to 33.4.7-jre by @scala-steward in #3625
- Update Scala Next RC to 3.7.0-RC2 by @Gedochao in #3628
- Update core_2.13 to 3.11.0 by @scala-steward in https://github.co...
v1.7.1
Support for Scala 3.6.4
This Scala CLI version switches the default Scala version to 3.6.4.
scala-cli version
# Scala CLI version: 1.7.1
# Scala version (default): 3.6.4
Support the --test
command line option for doc
It is now possible to generate docs from the test scope with the --test
flag.
Features
Internal and build changes
Documentation changes
Updates
- Update jsoup to 1.19.1 by @scala-steward in #3542
- Update scala-cli.sh launcher for 1.7.0 by @github-actions in #3543
- Bump Scala 3 Next to 3.6.4 by @Gedochao in #3544
- Bump SBT to 1.10.10 by @Gedochao in #3545
- Update semanticdb-shared_2.13 to 4.13.3 by @scala-steward in #3549
- Update scalafmt-cli_2.13, scalafmt-core to 3.9.3 by @scala-steward in #3548
- Bump
scala-cli-signing
to 0.2.6 by @Gedochao in #3552 - Bump react-player from 2.11.2 to 2.16.0 in /website by @dependabot in #3561
- Bump dorny/test-reporter from 1 to 2 by @dependabot in #3559
- Bump docusaurus-plugin-sass from 0.2.5 to 0.2.6 in /website by @dependabot in #3563
- Back port of documentation changes to main by @github-actions in #3565
- Update scalafmt-cli_2.13, scalafmt-core to 3.9.4 by @scala-steward in #3567
- Bump @easyops-cn/docusaurus-search-local from 0.38.1 to 0.49.1 in /website by @dependabot in #3562
- Update announced Scala 3 Next to 3.6.4 by @Gedochao in #3569
- Update semanticdb-shared_2.13 to 4.13.4 by @scala-steward in #3568
v1.7.0
Switch to scalameta/scalafmt
images of scalafmt
3.9.1+
Since version 3.9.1 scalafmt
ships with native images built with Scala Native. As a result, we are sunsetting https://github.com/virtuslab/scalafmt-native-image and Scala CLI will use the artifacts from https://github.com/scalameta/scalafmt for scalafmt
versions >=3.9.1
Note that older Scala CLI versions may still attempt to download a native image from the old repository for the new versions.
We will keep releasing those for a short while to help late upgraders migrate.
scala-cli fmt -F -version
# scalafmt 3.9.2
Support the --test
command line option for run
and package
It is now possible to run
a main method from the test scope with the --test
flag.
//> using target.scope test
@main def helloFromTestScope(): Unit = println("Hello from the test scope!")
scala-cli run HelloFromTestScope.scala --test --power
# Hello from the test scope!
Similarly, it is now possible to package
the main and test scopes together, using the same --test
flag.
scala-cli package HelloFromTestScope.scala --test --power
# # Wrote ./helloFromTestScope, run it with
# ./helloFromTestScope
./helloFromTestScope
# Hello from the test scope!
Keep in mind that the test and main scopes are still separate compilation units, where the test scope depends on the main scope (while the reverse isn't true).
Added by @Gedochao in #3502 and #3519
Detect objects with main class in scripts
Scala CLI now detects objects with a main method in scripts and runs them by default.
object Main {
def main(args: Array[String]): Unit = println("Hello")
}
Do note that, this is chiefly a convenience feature for migration of old scripts, using the old, legacy scala
runner.
If any top-level code is present alongside an object with a main method, the top-level code will be run instead and a warning printed.
object Main {
def main(args: Array[String]): Unit = println("Hello")
}
println("Top level code says hello")
scala-cli run scriptWithMainObjectAndTopLevel.sc
# [warn] Script contains objects with main methods and top-level statements, only the latter will be run.
# Compiling project (Scala 3.6.3, JVM (23))
# Compiled project (Scala 3.6.3, JVM (23))
# Top level code says hello
Additionally, cases where multiple main methods are present in the same script are not supported, inidicated by a warning.
object Main {
def main(args: Array[String]): Unit = println("Hello1")
}
object Main2 {
def main(args: Array[String]): Unit = println("Hello2")
}
Note that no output is printed in this example:
scala-cli run scriptWithMultipleMainObjects.sc
# [warn] Only a single main is allowed within scripts. Multiple main classes were found in the script: Main, Main2
# Compiling project (Scala 3.6.3, JVM (23))
# Compiled project (Scala 3.6.3, JVM (23))
Finally, main methods defined in this way cannot be chosen via the --main-class
command line option directive, and neither will they be printed by the --list-main-methods
flag.
Support for Scala Native 0.5.7
This Scala CLI version switches the default Scala Native version to 0.5.7.
scala-cli -e 'println("Hello from Scala Native 0.5.7!")' --native
# Compiling project (Scala 3.6.3, Scala Native 0.5.7)
# Compiled project (Scala 3.6.3, Scala Native 0.5.7)
# [info] Linking (multithreadingEnabled=true, disable if not used) (1045 ms)
# [info] Discovered 915 classes and 5608 methods after classloading
# [info] Checking intermediate code (quick) (41 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) (352 ms)
# [info] Discovered 498 classes and 2506 methods after classloading
# [info] Checking intermediate code (quick) (9 ms)
# [info] Discovered 477 classes and 1930 methods after optimization
# [info] Optimizing (debug mode) (608 ms)
# [info] Produced 9 LLVM IR files
# [info] Generating intermediate code (650 ms)
# [info] Compiling to native code (1674 ms)
# [info] Linking with [pthread, dl, m]
# [info] Linking native code (immix gc, none lto) (339 ms)
# [info] Postprocessing (0 ms)
# [info] Total (4655 ms)
# Hello from Scala Native 0.5.7!
Added in #3527
Features
- improvement: Detect objects with main class in scripts by @tgodzik in #3479
- Add support for running a main method from the test scope by @Gedochao in #3502
- Support the
--test
flag with thepackage
sub-command by @Gedochao in #3519
Fixes
- Improve handling for parallel Scala CLI runs by @Gedochao in #3399
- fix: Don't compile docs if there is no need by @ghostbuster91 in #3503
- fix: correctly report error position on unknown directive without values by @kasiaMarek in #3518
Internal and build changes
- fix for #3510 by @philwalk in #3513
- Fall back to the
cs
command onPATH
in themill
script by @Gedochao in #3517
Documentation changes
Updates
- Update scala-cli.sh launcher for 1.6.2 by @github-actions in #3495
- Update metaconfig-typesafe-config to 0.15.0 by @scala-steward in #3497
- Update bloop-config_2.13 to 2.3.2 by @scala-steward in #3496
- Update semanticdb-shared_2.13 to 4.13.0 by @scala-steward in #3500
- Update ammonite to 3.0.2 by @scala-steward in #3504
- Update semanticdb-shared_2.13 to 4.13.1.1 by @scala-steward in #3508
- Update scalafix-interfaces to 0.14.1 by @scala-steward in #3511
- Update semanticdb-shared_2.13 to 4.13.2 by @scala-steward in #3515
- Update scalafix-interfaces to 0.14.2 by @scala-steward in #3514
- Update slf4j-nop to 2.0.17 by @scala-steward in #3520
- Bump Scala 3 Next RC to 3.6.4-RC2 by @Gedochao in #3525
- Update Scala Native to 0.5.7 by @scala-steward in #3527
- Bump
scala-packager
to 0.1.32 & linux CI runners toubuntu-24.04
by @Gedochao in #3528 - Update
scalafmt
to 3.9.1 by @Gedochao in #3521 - Bump
scalafmt
to 3.9.2 by @Gedochao in #3533 - Bump gifs tests Ubuntu Docker image to
ubuntu:24.04
by @Gedochao in #3534 - Update sbt, scripted-plugin to 1.10.9 by @scala-steward in #3537
- Bump Linux ARM64 Docker image to
ubuntu:24.04
by @Gedochao in #3535
Full Changelog: v1.6.2...v1.7.0
v1.6.2
Support for Scala.js 1.18.2
This Scala CLI version adds support for Scala.js 1.18.2.
scala-cli -e 'println("Hello")' --js
# Compiling project (Scala 3.6.3, Scala.js 1.18.2)
# Compiled project (Scala 3.6.3, Scala.js 1.18.2)
# Hello
Added in #3454
Support for Scala 3.3.5
The Scala CLI internals are now built with Scala 3.3.5.
Deprecations
Fixes
- Remove conflicting Scala 2.13
io.get-coursier:dependency
dependency & add a CI check by @Gedochao in #3472
Internal and build changes
- Fix Scala Steward post-update hook by @fthomas in #3465
- Bump Windows runners to windows-2025 on the CI by @Gedochao in #3489
Documentation changes
- Add warning about test files in publish docs by @majk-p in #3486
- Back port of documentation changes to main by @github-actions in #3487
Updates
- Update scala-cli.sh launcher for 1.6.1 by @github-actions in #3452
- Update munit to 1.1.0 by @scala-steward in #3455
- Update latest announced Scala 3 Next RC to 3.6.4-RC1 by @Gedochao in #3458
- Update scalajs-sbt-test-adapter_2.13 to 1.18.2 by @scala-steward in #3454
- Update Scala 3 LTS to 3.3.5 by @Gedochao in #3466
- Update scalafmt-cli_2.13, scalafmt-core to 3.8.6 by @scala-steward in #3462
- Update sbt, scripted-plugin to 1.10.7 by @scala-steward in #3461
- Bump Scala 3 Next announced version to 3.6.3 by @Gedochao in #3469
- Bump
ammonite
to 3.0.1 by @Gedochao in #3468 - Update core_2.13 to 3.10.3 by @scala-steward in #3476
- Update scala-collection-compat to 2.13.0 by @scala-steward in #3478
- Update case-app to 2.1.0-M30 by @scala-steward in #3485
- Bump Scala toolkit to 0.6.0 by @Gedochao in #3471
- Update Scala Toolkit to 0.7.0 by @Gedochao in #3488
New Contributors
Full Changelog: v1.6.1...v1.6.2
v1.6.1
Pass --repl-init-script
directly to the Scala REPL
Passing an initialization script to the REPL with --repl-init-script
is now allowed directly, rather than after --
or with -O
.
The --repl-init-script
is a REPL option introduced in Scala 3.6.4, so it's not available for earlier Scala versions.
scala-cli repl -S 3.6.4-RC1 --repl-init-script 'println("Hello")'
# Hello
# Welcome to Scala 3.6.4-RC1 (23.0.1, Java OpenJDK 64-Bit Server VM).
# Type in expressions for evaluation. Or try :help.
#
# scala>
Hotfix release
Although Scala CLI 1.6.1 includes a few updates and improvements, it is primarily a hotfix release for version 1.6.0, which due to technical limitations wasn't available on some of our distribution channels.
For extra context refer to:
Features
Internal and build changes
Updates
- Bump Scala CLI launchers to v1.6.0 by @Gedochao in #3450
- chore: Update Bloop to 2.0.8 by @tgodzik in #3449
- Update scalafmt to 3.8.5 by @scala-steward in #3442
Full Changelog: v1.6.0...v1.6.1
v1.6.0
Scala CLI 1.6.0 will not be available on all distribution channels
Due to technical difficulties with our release pipeline, Scala CLI 1.6.0 release distribution channels were limited to:
- its GitHub release page, where launchers for all platforms are available as normal
- Maven Central
- WinGet
- Chocolatey
While it can be used as such, it was followed up with a hotfix 1.6.1 release, which should be available through all standard distribution channels.
Fixed commas being treated as using
directive value separators & deprecated using them with whitespace
NOTE: these are breaking changes affecting using directives syntax.
They're technically fixes + a deprecation, but in a very rare scenario existing builds could break, if they were relying on the erroneous syntax.
This Scala CLI version fixes commas (,
) being treated as using
directive value separators on their own.
Formerly, a directive like:
//> using options -Wunused:locals,privates
Would be (erroneously) interpreted as the following 2 options for the compiler: -Wunused:locals
and privates
.
As a comma will now no longer be treated as a separator (which it never should have been), it will now be interpreted correctly as
a single option: -Wunused:locals,privates
.
Before this change, the only way to pass this value to the options
directive key was escaping the comma with double quotes:
//> using options "-Wunused:locals,privates"
The escaping is no longer necessary.
Additionally, using commas along with whitespace as separators is now deprecated for future removal.
scala-cli compile --scala-snippet '//> using options -Wunused:locals, -Wunused:privates'
# [warn] <snippet>-scala-snippet:1:34
# [warn] Use of commas as separators is deprecated. Only whitespace is neccessary.
# Starting compilation server
# Compiling project (Scala 3.6.3, JVM (23))
# Compiled project (Scala 3.6.3, JVM (23))
Finally, the use of /* (..) */
comments in using
directives is no longer supported.
//> using /* some comment */ options -Wunused:locals /* some other comment */ -Wunused:privates
// this syntax used to be supported, but will now fail.
Added by @Gedochao in #3381 and #3333 and
Cap vague Scala versions at defaults
NOTE: this is a breaking change regarding how the Scala version is resolved.
We have changed how a Scala version is picked when major
or major.minor
prefixes are passed, rather than the full version tag:
-S 3
will now point to the launcher default Scala 3 Next version, rather than whatever is the latest stable version thatcoursier
can find upstream- similarly,
-S 3.<current launcher default minor>
will now point to the launcher default Scala 3 Next version -S 2.13
will point to the launcher default Scala 2.13 version (which up till now only affected tests and generated docs)- similarly,
-S 2.12
will now point to the launcher default Scala 2.12 version - launcher defaults are overridden for a particular Scala series with the
--cli-user-scala-version
to accommodate for Scala CLI installed asscala
For example:
//> using scala 3
// When compiled with Scala CLI v1.6.0, this snippet will use Scala 3.6.3 (the built-in default), even if a newer version has been released.
Support for Scala 3.6.3 and 2.13.16
This Scala CLI version switches the default Scala version to 3.6.3.
scala-cli version
# Scala CLI version: 1.6.0
# Scala version (default): 3.6.3
It has also been tested with Scala 2.13.16.
Added by @Gedochao in #3426 and #3418
Support for Scala.js 1.18.1
This Scala CLI version adds support for Scala.js 1.18.1.
scala-cli -e 'println("Hello")' --js
# Compiling project (Scala 3.6.3, Scala.js 1.18.1)
# Compiled project (Scala 3.6.3, Scala.js 1.18.1)
# Hello
Added in #3440 and VirtusLab/scala-js-cli#113
(⚡️ experimental) scalafix
integration
We now support running scalafix
rules with the fix
sub-command.
scala-cli fix . --power
# The `fix` sub-command is experimental
# Please bear in mind that non-ideal user experience should be expected.
# If you encounter any bugs or have feedback to share, make sure to reach out to the maintenance team at https://github.com/VirtusLab/scala-cli
# Running built-in rules...
# Writing project.scala
# Removing directives from Smth.scala
# Built-in rules completed.
# Running scalafix rules...
# Starting compilation server
# Compiling project (Scala 3.6.3, JVM (23))
# [warn] ./Main.scala:2:7
# [warn] unused local definition
# [warn] val unused = "unused"
# [warn] ^^^^^^
# Compiled project (Scala 3.6.3, JVM (23))
# scalafix rules completed.
Former fix functionalities are now referred to in the code as the built-in rules.
Effectively, fix now runs 2 separate sets of rules (both enabled by default): built-in and scalafix.
They can be controlled via the --enable-scalafix
and --enable-built-in
command line options.
scalafix
rules are ran according to the configuration in <project-root>/.scalafix.conf
.
It is possible to run external scalafix rules
with the (⚡️ experimental) scalafix.dep
directive:
//> using scalafix.dep com.github.xuwei-k::scalafix-rules:0.6.0
Added by @Vigorge and @dos65 in #2968
Support for running snapshot versions of the build server (Bloop)
It is now possible to pass a snapshot version to the --bloop-version
command line option.
scala-cli compile . --bloop-version 2.0.7-8-fe3f53d9-SNAPSHOT
# Starting compilation server
# Compiling project (Scala 3.6.3, JVM (23))
# Compiled project (Scala 3.6.3, JVM (23))
scala-cli --power bloop about
# bloop v2.0.7-8-fe3f53d9-SNAPSHOT
#
# Using Scala v2.12.20 and Zinc v1.10.7
# Running on Java JDK v23.0.1 (~/Library/Caches/Coursier/arc/https/github.com/adoptium/temurin23-binaries/releases/download/jdk-23.0.1%252B11/OpenJDK23U-jdk_aarch64_mac_hotspot_23.0.1_11.tar.gz/jdk-23.0.1+11/Contents/Home)
# -> Supports debugging user code, Java Debug Interface (JDI) is available.
# Maintained by the Scala Center and the community.
Support for suppressing deprecation warnings
It is now possible to suppress deprecation warnings with the --suppress-deprecated-warnings
command line option.
scala-cli project-with-deprecated-stuff --suppress-deprecated-warnings
You can also suppress deprecation warnings globally by setting the suppress-warning.deprecated-features
configuration key.
scala-cli config suppress-warning.deprecated-features true
Features
- Scalafix command for scala-cli with basic options and tests by @Vigorge and @dos65 in #2968
- Ensure vague Scala versions are capped at defaults by @Gedochao in #3259
- Merge
scalafix
intofix
by @Gedochao in #3400 - Allow to use Bloop snapshot versions by @Gedochao in #3405
- Add ways to suppress deprecation warnings by @Gedochao in #3406
Fixes
- Misc improvements in compiler options handling by @Gedochao in #3253
- Allow shading of single-choice compiler options from the command line regardless of
-
/--
prefix by @Gedochao in #3279 - Fix dependency main class detection throwing an NPE when JAR manifest doesn't list the main class correctly by @Gedochao in #3319
- Fix commas being treated as
using
directives value separators & deprecate using them with whitespace by @Gedochao in #3333 - Retain Bloop connection when restarting a build with
--watch
by @Gedochao in #3351 - Improve deprecation warnings for commas with whitespace used as using directive value separators by @Gedochao in #3366
- Recover from invalid paths returned from Bloop diagnostics by @Gedochao in #3372
- Add missing support for excluding transient dependencies when publishing by @Gedochao in #3357
- Fix using directives crashing on
*/
by removing/* (..) */
comments support inusing_directives
by @Gedochao in #3381 fix
built-in rules: don't wrap directive values in double quotes if not necessary by @Gedochao in ht...
v1.5.4
Hotfix release
Although Scala CLI 1.5.4 includes a few updates and improvements, it is primarily a hotfix release for versions 1.5.2 and 1.5.3, which due to technical limitations weren't available on some of our distribution channels.
Extra context:
The main list of enhancements and fixes is listed in the release notes for 1.5.2.
Support for Scala Native 0.5.6
This Scala CLI version switches the default Scala Native version to 0.5.6.
scala-cli -e 'println("Hello from Scala Native 0.5.6!")' --native
# Compiling project (Scala 3.5.2, Scala Native 0.5.6)
# Compiled project (Scala 3.5.2, Scala Native 0.5.6)
# [info] Linking (multithreadingEnabled=true, disable if not used) (949 ms)
# [info] Discovered 887 classes and 5408 methods after classloading
# [info] Checking intermediate code (quick) (40 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) (285 ms)
# [info] Discovered 499 classes and 2500 methods after classloading
# [info] Checking intermediate code (quick) (7 ms)
# [info] Discovered 478 classes and 1914 methods after optimization
# [info] Optimizing (debug mode) (429 ms)
# [info] Produced 9 LLVM IR files
# [info] Generating intermediate code (296 ms)
# [info] Compiling to native code (1464 ms)
# [info] Linking with [pthread, dl]
# [info] Linking native code (immix gc, none lto) (208 ms)
# [info] Postprocessing (0 ms)
# [info] Total (3728 ms)
# Hello from Scala Native 0.5.6!
Internal changes
- Pin Fedora docker image at
fedora:40
by @Gedochao in #3283 - Don't fail the
update-packages
andwindows-packages
jobs on individual distributions' steps by @Gedochao in #3288
Documentation changes
- Fix broken example in
//> using dep
reference doc by @Gedochao in #3281 - Mention distribution limitations in the Scala CLI 1.5.3 release notes by @Gedochao in #3286
- Back port of documentation changes to main by @github-actions in #3287
Updates
- Update
mill-native-image
to 0.1.29 by @Gedochao in #3278 - Update expecty to 0.17.0 by @scala-steward in #3277
- Update Bloop to 2.0.5 by @Gedochao in #3276
- Update dependency to 0.2.5 by @scala-steward in #3269
- Update
coursier
to 2.1.17 by @Gedochao in #3275 - Update SBT to 1.10.5 by @Gedochao in #3280
- Update
java-class-name
to 0.1.4 by @Gedochao in #3284 - Update scala-cli.sh launcher for 1.5.3 by @Gedochao in #3285
- Update Scala Native to 0.5.6 by @Gedochao in #3295
- Update Mill to 0.11.13 by @Gedochao in #3296
- Update coursier to 2.1.17 for Linux arm64 builds by @Gedochao in #3298
- Update coursier/dependency to 0.3.1 by @Gedochao in #3297
Full Changelog: v1.5.3...v1.5.4
v1.5.3
This is a hotfix release, which makes all the fixes and enhancements of Scala CLI 1.5.2 available through most standard distribution channels (rather than just Maven Central).
For the main release notes, please refer to the v1.5.2 ones.
Distribution limitations
Due to technical difficulties within our release pipeline, Scala CLI 1.5.3 is not available via the following channels:
yum
(on RedHat/Cent OS/Fedora)SDKMAN!
We will follow up with a 1.5.4 hotfix release to address this issue.
Hot-fixes
- Tag failing native packager tests as flaky by @Gedochao in #3270
- Make publishing depend on all integration tests & docs tests by @Gedochao in #3272
Full Changelog: v1.5.2...v1.5.3
v1.5.2
Scala CLI 1.5.2 will only be available on the JVM
Due to technical difficulties with our release pipeline, Scala CLI 1.5.2 was only released as a JVM launcher on Maven Central. While it can be used as such, we will follow it up with a hotfix 1.5.3 release, which should be available through all standard distribution channels.
scala-cli --cli-version 1.5.2 version
# Scala CLI version: 1.5.2
# Scala version (default): 3.5.2
--source
is now deprecated and scheduled for removal in Scala CLI v1.6.x
Due to how easy it is to confuse --source
(the command line option for producing source JARs with the package
sub-command) and -source
(the Scala compiler option, which can also be passed as --source
in recent Scala 3 versions), using the former is now deprecated, and will likely be removed in Scala CLI v1.6.x.
scala-cli --power package --source .
# [warn] The --source option alias has been deprecated and may be removed in a future version.
# (...)
Do note that the deprecation (and future removal) only affects the option alias.
The feature of packaging source JARs remains unchanged.
It is now recommended to switch to using the --src
alias instead.
scala-cli --power package --src .
Support for Scala 3.5.2
This Scala CLI version switches the default Scala version to 3.5.2.
scala-cli version
# Scala CLI version: 1.5.2
# Scala version (default): 3.5.2
Initial support for emitting Wasm with a command line option and a directive
It is now possible to emit Wasm via Scala.js with the //> using jsEmitWasm
directive:
//> using platform js
//> using jsEmitWasm
//> using jsModuleKind es
//> using jsModuleSplitStyleStr fewestmodules
println("Hello")
Or with the --js-emit-wasm
command line option:
scala-cli --power package wasm.sc --js --js-emit-wasm
# The `--js-emit-wasm` option is experimental
# Please bear in mind that non-ideal user experience should be expected.
# If you encounter any bugs or have feedback to share, make sure to reach out to the maintenance team at https://github.com/VirtusLab/scala-cli
# Compiling project (Scala 3.5.2, Scala.js 1.17.0)
# Compiled project (Scala 3.5.2, Scala.js 1.17.0)
# Wrote ~/wasm/wasm.js/main.js, run it with
# node ./wasm.js/main.js
tree wasm.js
# wasm.js
# ├── __loader.js
# ├── main.js
# └── main.wasm
#
# 1 directory, 3 files
For more information about Wasm (WebAssembly) support via Scala.js, refer here.
Features
Deprecations
Fixes
- Fix
--watch
to work correctly with changingusing
directives & sources requiring code generation (scripts, markdown, etc) by @Gedochao in #3218 - Ensure resource directories passed via a using directive aren't ignored in
--watch
mode by @Gedochao in #3221 - Ensure consecutive
-Wconf:*
flags are not ignored by @Gedochao in #3245
Documentation changes
- Mention the
Fix
command in theUsing directives
guide by @dabrowski-adam in #3239 - Back port of documentation changes to main by @github-actions in #3242
Updates
- Update scala-cli.sh launcher for 1.5.1 by @github-actions in #3217
- Update sttp to 3.10.0 by @scala-steward in #3219
- Update asm to 9.7.1 by @scala-steward in #3223
- Update bloop-rifle_2.13 to 2.0.3 by @scala-steward in #3225
- Update bloop-config_2.13 to 2.1.0 by @scala-steward in #3228
- chore: Update next to 3.5.2-RC2 by @tgodzik in #3224
- Update
coursier
to 2.1.14 by @scala-steward in #3226 - Update core_2.13 to 3.10.1 by @scala-steward in #3229
- Update
os-lib
to 0.11.2 by @Gedochao in #3232 - Update sbt, scripted-plugin to 1.10.3 by @scala-steward in #3235
- Update dependency to 0.2.4 by @scala-steward in #3234
- Bump Scala Next to 3.5.2 by @Gedochao in #3230
- Update os-lib to 0.11.3 by @scala-steward in #3240
- Set Scala 3.5.2 as the latest announced Scala Next version by @Gedochao in #3243
- Set Scala 3.6.1 as the Next RC version (which it effectively is) by @Gedochao in #3244
- Update dependencies in
gh-action.md
examples by @kubukoz in #3249 - Bump
scala-js-cli
to 1.17.0.1 by @Gedochao in #3252
New Contributors
- @dabrowski-adam made their first contribution in #3239
Full Changelog: v1.5.1...v1.5.2
Latest launchers
Merge pull request #3257 from Gedochao/maintenance/deprecate-source Deprecate the `--source` command line option for the `package` sub-command