Skip to content

Releases: VirtusLab/scala-cli

v1.11.0

12 Dec 06:43
4832457

Choose a tag to compare

Change default Scala versions to 2.13.18 and 2.12.21

This Scala CLI version switches the default Scala versions:

  • default Scala 2.13 to 2.13.18
  • default Scala 2.12 to 2.12.21

Added by @Gedochao in #3999 and #3958

Fall back to a legacy version of the runner & test-runner modules for JVM < 17

The newest versions of the runner and test-runner modules will require Java 17 or newer to run.
When trying to use them with older JVMs, Scala CLI will now print a warning and fall back to using legacy versions of those modules instead.

scala-cli test . --jvm 11
# Compiling project (Scala 3.7.4, JVM (11))
# Compiled project (Scala 3.7.4, JVM (11))
# [warn] Java 11 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 Java to at least 17.

Added by @Gedochao in #3965

Features & improvements

Fixes

  • fix for 3307 (windows launcher rejects filenames with utf8 chars) by @philwalk in #3923
  • Allow for repeatable -XX:* Java options by @Gedochao in #3976
  • fix #3979 by adding save-and-restore to generated run-native-image.bat by @philwalk in #3981
  • Fix handling of multiple exclude directives by @tom91136 in #3984
  • Fix doc generation for projects with compile-only dependencies by @Gedochao in #3990
  • Rewrite Scala.js linking to enable packaging of projects without a main method by @Gedochao in #3992

Deprecations

  • Fall back to legacy runner / test-runner for JVM < 17 by @Gedochao in #3965

Documentation changes

  • Add examples for passing REPL options via using directive to the docs by @Gedochao in #3975
  • Back port of documentation changes to main by @github-actions[bot] in #3978

Build and internal changes

  • Increase CI timeout for integration tests to 150 minutes by @Gedochao in #3955
  • Run the entire REPL test suite on both Ammonite and Scala 3 REPL by @Gedochao in #3982
  • Clean cached JDKs on Linux CI runners by @Gedochao in #3995

Updates

New Contributors

Full Changelog: v1.10.1...v1.11.0

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