Skip to content

Releases: VirtusLab/scala-cli

v1.10.1

13 Nov 23:46
9197944

Choose a tag to compare

This is a bugfix release, chiefly aiming to mend #3949, which affected several of our users.

Fixes

  • Ensure Coursier logger gets initialized while downloading JVMs by @Gedochao in #3951

Documentation changes

  • Back port of documentation changes to main by @github-actions[bot] in #3948

Build and internal changes

Updates

  • Bump Node to 24 for the docs website by @Gedochao in #3947
  • Update scala-cli.sh launcher for 1.10.0 by @github-actions[bot] in #3946

Full Changelog: v1.10.0...v1.10.1

v1.10.0

07 Nov 09:32
4042f68

Choose a tag to compare

Change default Scala versions to 3.7.4 and 2.13.17

This Scala CLI version switches the default Scala versions:

  • default Scala 3 to 3.7.4
  • default Scala 2.13 to 2.13.17
scala-cli version
# Scala CLI version: 1.10.0
# Scala version (default): 3.7.4

Added by @Gedochao in #3942 and #3895

Support for the new Scala 3.8 REPL

As per scala/scala3#24243, Scala 3 REPL has been extracted to a separate artifact in Scala 3.8, as a result of which the use of the REPL command with Scala 3.8.0-RC1-bin-20251101-389483e-NIGHTLY or newer will require upgrading Scala CLI at least to 1.10 to work.

scala-cli repl                                          
# Welcome to Scala 3.8.0-RC1-bin-20251101-389483e-NIGHTLY (23.0.1, Java OpenJDK 64-Bit Server VM).
# Type in expressions for evaluation. Or try :help.
#                                                                                                                  
# scala> 

Added by @Gedochao in #3936

Support for adding extra directories to a Docker image

This feature adds the ability to include additional directories in Docker images. Users can now specify extra directories to be copied into a Docker image during the build process. The directories can be passed with the --docker-extra-directories command line option or //> using packaging.dockerExtraDirectories directive.

//> using packaging.dockerExtraDirectories path/to/directory1 path/to/directory2
scala-cli --power package . --docker --docker-image-repository repo --docker-extra-directories path/to/directory

Added by @btomala and @Gedochao in VirtusLab/scala-packager#250 and #3908

Deprecate support for building GraalVM native images with Scala pre-3.3

When building GraalVM native images with Scala CLI and Scala versions older than 3.3.0, the following warning will now be printed:

# [warning] building native images with Scala 3 older than 3.3.0 is deprecated.
# [warning] support will be dropped in a future Scala CLI version.
# [warning] it is advised to upgrade to a more recent Scala version

While the native images will still be built, the functionality will be removed in a future Scala CLI version. It is advised to migrate projects to Scala 3.3 or newer.

Additionally, the following modules have been dropped and will no longer be published:

  • scala3-runtime
  • scala3-graal
  • scala3-graal-processor

As they remain necessary for building native images for Scala pre-3.3 projects, their usage has been deprecated and frozen at respective version 1.9.1.

Added by @Gedochao in #3929

Stop publishing certain modules for Scala 2

While it is technically an internal change, it is worth noting certain Scala CLI modules will no longer be published for Scala 2.
Those include:

  • runner
  • test-runner
  • tasty-lib
  • config
  • specification-level

From this point on, they will only be published for Scala 3.

Added by @Gedochao in #3911 and #3912

Features

Fixes

  • Ensure non-self executable JVM launchers' setup-ide produces working BSP connection JSON by @Gedochao in #3876
  • Fix test scope resources to not be added to the main scope by @Gedochao in #3898

Documentation changes

Build and internal changes

  • Run the default (Scala 3 Next) suite with the JVM bootstrapped launcher on the CI by @Gedochao in #3872
  • Run JDK tests for Java 25 by @Gedochao in #3874
  • Update MacOS CI by @Gedochao in #3885
  • Add .cursor to .gitignore by @Gedochao in #3893
  • Unify cli module unit tests with consistent logging, timeouts and other settings by @Gedochao in #3896
  • Cross compile the runner and test-runner modules against Scala 3 Next versions by @Gedochao in #3927
  • Migrate integration tests to Scala 3 by @Gedochao in #3926
  • Misc unit test fixes by @Gedochao in #3931
  • Temporarily tag CLI docker image tests as flaky by @Gedochao in #3939
  • Temporarily tag CLI docker image documentation tests as flaky by @Gedochao in #3940
  • Temporarily disable some more flaky CLI docker image documentation tests by @Gedochao in #3941
  • Drop Scala 2 in runner, test-runner and tasty-lib modules by @Gedochao in #3911
  • Drop Scala 2 in config and specification-level modules & bump jsoniter-scala to 2.38.2 (was 2.13.5.2) by @Gedochao in #3912
  • NIT Fix miscellaneous warnings by @Gedochao in #3913
  • NIT Fix more miscellaneous warnings by @Gedochao in #3920
  • Drop scala3-runtime, scala3-graal & scala3-graal-processor & deprecate pre-Scala-3.3 native images by @Gedochao in #3929

Updates

New Contributors

Full Changelog: v1.9.1...v1.10.0

v1.9.1

17 Sep 12:05
82b39a2

Choose a tag to compare

Support for Scala 3.7.3

This Scala CLI version switches the default Scala version to 3.7.3.

scala-cli version
# Scala CLI version: 1.9.1
# Scala version (default): 3.7.3

Added by @Gedochao in #3866

Support for Scala.js 1.20.1

This Scala CLI version adds support for Scala.js 1.20.1.

scala-cli -e 'println("Hello")' --js
# Compiling project (Scala 3.7.3, Scala.js 1.20.1)
# Compiled project (Scala 3.7.3, Scala.js 1.20.1)
# Hello

Added by @Gedochao in #3861 and VirtusLab/scala-js-cli#160

Fixes

  • Fix completely broken lock during setting up local repo on Linux by @unlsycn in #3846
  • Ensure publish actually fails on a failed upload by @Gedochao in #3853

Updates

Full Changelog: v1.9.0...v1.9.1

v1.9.0

01 Sep 13:06
75f3095

Choose a tag to compare

Support for the new Scala 3 nightly repository

This Scala CLI version supports the new Scala 3 nightly versions repository:

https://repo.scala-lang.org/artifactory/maven-nightlies

This means that newest Scala 3 nightly versions will become available to use with Scala CLI, as well as the 3.nightly tag will now refer to the actual, newest version.

As a result, Scala 3.8 features like capture checked Scala 3 library should now be available from Scala CLI.

//> using scala 3.8.0-RC1-bin-20250901-ca400bd-NIGHTLY
import language.experimental.captureChecking

trait File extends caps.SharedCapability:
  def count(): Int

def f(file: File): IterableOnce[Int]^{file} =
  Iterator(1)
    .map(_ + file.count())

Added by @Gedochao in #3838

Features

  • Add support for the new Scala 3 nightly repository by @Gedochao in #3838

Fixes

  • Fix using directive with URL + query parameters by @jgoday in #3835

Documentation changes

  • Update the Scala CLI docs landing page by @Gedochao in #3825
  • Back port of documentation changes to main by @github-actions[bot] in #3826

Build and internal changes

Updates

New Contributors

Full Changelog: v1.8.5...v1.9.0

v1.8.5

06 Aug 21:09
3ceeaec

Choose a tag to compare

Support for Scala 3.7.2

This Scala CLI version switches the default Scala version to 3.7.2.

scala-cli version
# Scala CLI version: 1.8.5
# Scala version (default): 3.7.2

Added by @Gedochao in #3809

Add props with input paths for non-script inputs

2 new properties have been added, to provide a way to access input paths outside of .sc scripts:

  • scala.sources - full paths of all inputs in the project, separated by java.io.File.pathSeparator
  • scala.source.names - names of all inputs in the project, separated by java.io.File.pathSeparator
//PrintSources.scala
@main def main() = {
  println(sys.props("scala.sources"))
  println(sys.props("scala.source.names"))
}
~/PrintSources.scala
PrintSources.scala

These are meant to be an input type agnostic equivalent for the scriptPath method available in .sc scripts.

Added by @philwalk in #3799

sonatype:snapshots points to the new Sonatype Central snapshots repository

It is no longer necessary to manually add https://central.sonatype.com/repository/maven-snapshots, it is added under the sonatype:snapshots alias (along with the old snapshot repository).
It is also added in all other contexts when snapshots should be used.

//> using repository sonatype:snapshots

Added by @Gedochao in #3797

Scala CLI nightlies are available again

We once again publish Scala CLI nightlies. You can use the newest version under the nightly tag.
As pre-1.8.5 Scala CLI versions do not look for them on the new Sonatype Central snapshots repository, they will not be visible when called from earlier versions.

scala-cli --cli-version nightly version
# Scala CLI version: 1.8.4-24-g8ca6c960b-SNAPSHOT
# Scala version (default): 3.7.2

Note that the new Sonatype Central Portal retains snapshot versions for 90 days, so individual versions will be available to test for a limited time period.

Added by @Gedochao in #3818

Features

  • Automatically add the new Sonatype Central Portal snapshots repository when snapshots are expected to be used by @Gedochao in #3797
  • Adjust Scala CLI nightly version resolution for the new Maven Central Snapshots repository by @Gedochao in #3818
  • provide a way to access paths of source files by @philwalk in #3799
  • Add more logging for publishing by @Gedochao in #3813

Fixes

Build and internal changes

  • Tag tests relying on old snapshots as flaky (or remove them where applicable) by @Gedochao in #3817
  • Add --no-fallback to graalvm native-image configuration by @lbialy in #3820

Updates

New Contributors

Full Changelog: v1.8.4...v1.8.5

v1.8.4

15 Jul 09:45
46a5de6

Choose a tag to compare

(⚡️ experimental) publish support for the Sonatype Central Portal

This Scala CLI version adds support for publishing artifacts to the Sonatype Central Portal via its OSSRH Staging API.
It is once again possible to publish artifacts to Maven Central with Scala CLI.
Both stable and *-SNAPSHOT versions are handled.
The only configuration change necessary is to migrate the Sonatype namespace in the UI and regenerate credentials to the new Sonatype Central Portal, as per Sonatype instructions

scala-cli publish . --power

Added by @Gedochao in #3774, #3776, #3778, coursier/publish#128 and coursier/publish#127

Better support for the REPL with JDK 24+

When using the REPL with JDK 24 or newer, users should no longer see the warnings about restricted methods of java.lang.System being used.

scala-cli repl --jvm 24
# WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
# WARNING: sun.misc.Unsafe::objectFieldOffset has been called by scala.runtime.LazyVals$ (file:/Users/pchabelski/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.7.1/scala3-library_3-3.7.1.jar)
# WARNING: Please consider reporting this to the maintainers of class scala.runtime.LazyVals$
# WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
# Welcome to Scala 3.7.1 (24.0.1, Java OpenJDK 64-Bit Server VM).
# Type in expressions for evaluation. Or try :help.
#            
#
# scala> 

Note that the deprecated method from sun.misc.Unsafe warning is still present, and will only be addressed in Scala 3.8.0.

Added by @Gedochao in #3767

Features

  • publish command with Sonatype Central Portal OSSRH Staging API by @Gedochao in #3774
  • Add support for publishing with Scala CLI to Sonatype Central Portal by @Gedochao in #3776

Fixes

  • Prevent the REPL from warning about restricted java.lang.System API on JDK 24 by @Gedochao in #3767
  • fix for 3725, 3752, 3766 and 3769 by @philwalk in #3726

Documentation changes

Updates

Full Changelog: v1.8.3...v1.8.4

v1.8.3

25 Jun 11:59
13427eb

Choose a tag to compare

This is a small release which aims to fix issues with publishing Scala CLI on Sonatype Central Portal.

Build and internal changes

  • Add extra logging on Scala CLI artifacts publishing by @Gedochao in #3745
  • [NIT] Refactor publishing by @Gedochao in #3743
  • Ensure publishing to Sonatype runs without parallelism by @Gedochao in #3755
  • Don't use any custom logic when publishing to Sonatype Central by @Gedochao in #3759
  • Print artifacts' version when publishing Scala CLI by @Gedochao in #3760
  • Don't prepend shell scripts for CLI bootstrapped fatJARs by @Gedochao in #3764

Updates

Full Changelog: v1.8.2...v1.8.3

v1.8.2

12 Jun 05:33
6ec4065

Choose a tag to compare

v1.8.2 Pre-release
Pre-release

Due to technical difficulties, this version is not available on Maven Central and on coursier. If you care about those installation methods, please be patient as we resolve the issue and work on a subsequent release.

Support for Scala Native 0.5.8

This Scala CLI version switches the default Scala Native version to 0.5.8.

scala-cli -e 'println("Hello from Scala Native 0.5.8!")' --native
# Compiling project (Scala 3.7.1, Scala Native 0.5.8)
# Compiled project (Scala 3.7.1, Scala Native 0.5.8)
# [info] Linking (multithreadingEnabled=true, disable if not used) (1052 ms)
# [info] Discovered 919 classes and 5640 methods after classloading
# [info] Checking intermediate code (quick) (59 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) (369 ms)
# [info] Discovered 511 classes and 2553 methods after classloading
# [info] Checking intermediate code (quick) (7 ms)
# [info] Discovered 491 classes and 1986 methods after optimization
# [info] Optimizing (debug mode) (519 ms)
# [info] Produced 9 LLVM IR files
# [info] Generating intermediate code (521 ms)
# [info] Compiling to native code (1762 ms)
# [info] Linking with [pthread, dl, m]
# [info] Linking native code (immix gc, none lto) (98 ms)
# [info] Postprocessing (0 ms)
# [info] Total (4379 ms)
# Hello from Scala Native 0.5.8!

Added in #3728

Internal and build changes

Updates

Full Changelog: v1.8.1...v1.8.2

v1.8.1

04 Jun 13:05
eeae7dd

Choose a tag to compare

Support for Scala 3.7.1

This Scala CLI version switches the default Scala version to 3.7.1.

scala-cli version
# Scala CLI version: 1.8.1
# Scala version (default): 3.7.1

Added by @Gedochao in #3707

Support for URLs in using file directives

It is now possible to use URLs in using file directives, which allows linking sources from the net.

//> using file https://raw.githubusercontent.com/softwaremill/sttp/refs/heads/master/examples/src/main/scala/sttp/client4/examples/json/GetAndParseJsonCatsEffectCirce.scala

Added during a Scala Tooling Spree by @ivan-klass, @majk-p and @tgodzik in #3681

Features

Fixes

Internal and build changes

  • bugfix: Fix mill script on fish by @tgodzik in #3700
  • Make test-fish-shell, test-hypothetical-sbt-export and bloop-memory-footprint required for publishing by @Gedochao in #3701
  • [NIT] Refactor Scala CLI CI scripts by @Gedochao in #3702
  • Remove the github-dependency-graph CI workflow by @Gedochao in #3703
  • Add more tests for URLs in using file directives by @Gedochao in #3706

Documentation changes

  • Fix Changing Java versions document by @tmrkw1497 in #3697
  • Back port of documentation changes to main by @github-actions in #3699

Updates

New Contributors

Full Changelog: v1.8.0...v1.8.1

v1.8.0

08 May 14:28
1fb78ff

Choose a tag to compare

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

Added by @Gedochao in #3661

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.

Added by @Gedochao in #3650

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.

Added by @Gedochao in #3653

Features

  • Support the --test flag with the publish & 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 the project.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 to SharedOptions by @Gedochao in #3612
  • Include missing Scala 3.6.* versions in Scala.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

Read more