Skip to content

Releases: VirtusLab/scala-cli

v1.15.0

Choose a tag to compare

@Gedochao Gedochao released this 29 Jun 13:45
ebc1847

Default Scala 3.8.4, Scala Native 0.5.12 & Scala.js 1.22.0

This Scala CLI version bumps the default Scala version to 3.8.4, Scala Native to 0.5.12 and Scala.js to 1.22.0.

scala-cli version
# Scala CLI version: 1.15.0
# Scala version (default): 3.8.4
scala-cli -e 'println("Hello from Scala.js 1.22.0!")' --js
# Compiling project (Scala 3.8.4, Scala.js 1.22.0)
# Compiled project (Scala 3.8.4, Scala.js 1.22.0)
# Hello from Scala.js 1.22.0!
scala-cli -e 'println("Hello from Scala Native 0.5.12!")' --native
# Compiling project (Scala 3.8.4, Scala Native 0.5.12)
# Compiled project (Scala 3.8.4, Scala Native 0.5.12)
# Hello from Scala Native 0.5.12!

Scala 3.8.4 was added by @Gedochao in #4299
Scala Native 0.5.12 was added by @WojciechMazur in #4286
Scala.js 1.22.0 was added by @Gedochao in #4344

JShell support in repl

scala-cli repl can now use JShell as its REPL backend, enabled with the --jshell (--jsh) flag. JShell is also picked automatically for pure-Java projects. The project's classpath (including dependencies) is available inside the JShell session, so you can play with your code (and even reference Scala classes via reflection). JShell requires JDK 9 or newer.

package demo;
public class HelloJShell {
  public static String greet() { return "Hello from JShell!"; }
}
System.out.println(demo.HelloJShell.greet());
scala-cli repl demo/HelloJShell.java --jshell --jvm 17 --repl-quit-after-init --repl-init-script-file hi.jsh

Note: It is possible to explicitly disable JShell on pure Java projects and revert to using Scala REPL with --jshell=false.

Added by @Gedochao in #4262

java snippets in Markdown inputs (experimental ⚡️)

Scala CLI can now compile and run java code blocks inside Markdown inputs, mirroring the existing support for scala snippets. A java snippet is treated like a regular .java input (its body is emitted as Java source without any wrapping). As with other Markdown features, this requires --power.

# Java in Markdown

```java
public class HelloMarkdown {
  public static void main(String[] args) {
    System.out.println("Hello from a Java snippet in Markdown!");
  }
}
```
scala-cli --power HelloMarkdown.md

Added by @Gedochao in #4284

WebAssembly support (experimental ⚡️)

Scala CLI can now compile and run Scala.js through the experimental Scala.js WebAssembly backend. Enable it with the --js-emit-wasm flag (or the //> using wasm directive) together with ES module output (--js-module-kind es / //> using jsModuleKind es).

The Wasm output runs on a JavaScript host that embeds a Wasm engine. Scala CLI does not bundle any of these runtimes — you have to install Node.js (the default), Deno or Bun yourself, then select one with --js-runtime. See the Scala.js with Wasm guide for the details and runtime version requirements.

//> using wasm
//> using jsModuleKind es

@main def hello(): Unit = println("Hello from Wasm!")
# Node.js is the default runtime - no runtime flag needed
scala-cli run HelloWasm.scala --power
# run the same Wasm output on Deno
scala-cli run HelloWasm.scala --power --js-runtime deno
# ...or on Bun
scala-cli run HelloWasm.scala --power --js-runtime bun

Added by @lostflydev in #4176

JUnit 5 (Jupiter) support

The test runner now supports JUnit 5 (Jupiter) via the jupiter-interface test interface, for both Scala and pure-Java tests. JUnit 5 requires Java 17 or newer.

//> using test.dep com.github.sbt.junit:jupiter-interface:0.19.0
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.Assertions.*

class MyJupiterTests {
  @Test
  def addition(): Unit = {
    assertEquals(4, 2 + 2)
    println("Hello from JUnit 5 / Jupiter!")
  }
}
scala-cli test MyJupiterTests.test.scala --jvm 17

Added by @Gedochao in #4304

SBT 2.x export

The export sub-command can now generate SBT 2.x builds (the default SBT version used for the export is now 2.0.0). Pick a specific version with --sbt-version.

@main def hello(): Unit = println("Hello from an SBT 2.x export!")
scala-cli --power export hello.scala --sbt --sbt-version 2.0.0 -o sbt-project
cat sbt-project/project/build.properties

Added by @Gedochao in #4327

Visual Studio 2026 support on Windows

When building Scala Native (or packaging GraalVM native images) on Windows, Scala CLI locates the MSVC toolchain from your Visual Studio installation. It now also detects Visual Studio 2026, and bundles the matching Visual C++ redistributable (vcredist) in the generated MSI installers.

Added by @Gedochao in #4331

Dropped Ammonite support

The Ammonite REPL integration has been removed (it was deprecated back in v1.13.0). The --ammonite (--amm), --ammonite-version and --ammonite-arg options are gone from scala-cli repl; use the default Scala REPL (or the new JShell backend for Java projects) instead.

scala-cli repl --ammonite

Added by @Gedochao in #4283

Features

Fixes

  • Restore BSP base directory to the original workspace regardless of permissions/ownership by @Gedochao in #4273
  • Improve dependency update actionable diagnostic handling for slow/unresponsive custom repositories by @Gedochao in #4272
  • Improve error for when JVM-only dependencies are not found on other platforms by @Gedochao in #4281
  • Don't save duplicate .scalafmt.conf if unnecessary by @Gedochao in #4291

Deprecations and removals

Build and internal changes

  • Compile the directives-parser example in Scala CLI v1.14.0 release notes by @Gedochao in #4278
  • Retire legacy KEYGRIP secret by @Gedochao in #4275
  • update-installation-script, update-centos and update-debian can't run in parallel by @Gedochao in #4277
  • Track threads & futures spawned in integration tests to make sure logs are in chronological order by @Gedochao in #4293
  • Mark Scala 2 nightly tests as flaky by @Gedochao in #4317
  • Disable test parallelism for unit tests on the CI by @Gedochao in #4316
  • Ensure scala-cli.sh logs to stderr by @alexarchambault in #4301
  • Add an extra test for VS detection on Windows + a small refactor by @Gedochao in #4328
  • Cut MacOS integration tests down to just sanity tests by @Gedochao in #4333
  • Add anti-regression tests for #4329 by @Gedochao in #4332
  • Treat Mill wrapper changes as build changes by @Gedochao in #4347

Updates

  • Update scala-cli.sh launcher for 1.14.0 by @github-actions[bot] in #4274
  • Bump the npm-dependencies group in /website with 3 updates by @dependabot[bot] in #4279
  • Bump webpack-dev-server from 5.2.2 to 5.2.4 in /website by @dependabot[bot] in #4280
  • Bump the npm-dependencies group in /website with 2 updates by @dependabot[bot] in #4287
  • Bump scalafmt to 3.11.1 (was 3.11.0) by @Gedochao in #4290
  • Bump Scala 3 Next RC to 3.8.4-RC3 by @Gedochao in https://g...
Read more

v1.14.0

Choose a tag to compare

@Gedochao Gedochao released this 14 May 22:12
1fee08e

Change default Scala Native version to 0.5.11

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

Added by @Gedochao in #4253

Support for .test.java

*.test.java files are now picked up as test-scope sources automatically, mirroring *.test.scala.
Under the hood, Scala CLI generates a matching .java source (so Example.test.java generates a matching Example.java source), so that javac accepts the public class.

//> using test.dep junit:junit:4.13.2
//> using test.dep com.novocode:junit-interface:0.11
import org.junit.Test;
import static org.junit.Assert.assertEquals;

public class ExampleTest {
  @Test public void foo() { assertEquals(4, 2 + 2); }
}
scala-cli test java-junit-example

Added by @Gedochao in #4261.

A toggle to turn auto-IDE-setup off

Build commands (such as compile, run, test) automatically write the BSP configuration under .bsp/ to keep IDE integration in sync.
This behavior can now be disabled per-invocation via --auto-setup-ide=false, or globally via the ide.auto-setup config key.

scala-cli compile java-junit-example --auto-setup-ide=false
# Compile without generating .bsp/ configuration
scala-cli config ide.auto-setup false
# Disable auto-setup-ide globally for all build commands

Added by @Gedochao in #4258.

New directives-parser module

The legacy Java using_directives parser has been replaced with a Scala-rewritten directives-parser module.
This is transparent to users, but resolves long-standing directive parsing issues (#2443, #3019, #2382) and unblocks future improvements to directive handling.

The directives parser can be used as a standalone library, so you can now parse using directives in your own tools and applications with the same logic as Scala CLI.

//> using scala 3
//> using dep org.virtuslab.scala-cli::directives-parser:1.14.0
import scala.cli.parse.UsingDirectivesParser

@main def parseDirectives(): Unit =
  val source =
    """//> using scala 3.7.4
      |//> using dep com.lihaoyi::os-lib:0.11.4
      |//> using options -Wunused:all -deprecation
      |
      |@main def hello() = println("Hello")
      |""".stripMargin
      
  val result = UsingDirectivesParser.parse(source.toCharArray)

  for d <- result.directives do
    val values = d.values.map(_.stringValue).mkString(", ")
    println(s"${d.key} = $values  (line ${d.keyPosition.line})")
    
  if result.diagnostics.nonEmpty then
    println("Diagnostics:")
    result.diagnostics.foreach(println)

Added by @Gedochao in #4192.

Typelevel Toolkit 0.2.0 (with Scala Native)

The Typelevel Toolkit dependency has been bumped to 0.2.0 and is now compatible with Scala Native 0.5.x.
It's worth mentioning that its test framework has been swapped from MUnit to Weaver.

//> using toolkit typelevel:default
//> using platform native

import cats.effect.*
import weaver.*

object HelloSuite extends SimpleIOSuite:
  test("hello") {
    IO("Hello").map(expect.eql(_, "Hello"))
  }

Added by @Gedochao in #4244.

Features

  • Migrate from old using_directives to Scala-rewritten directives-parser module by @Gedochao in #4192
  • Allow to disable auto-setup-ide in build commands with a command line option & config by @Gedochao in #4258
  • Support for .test.java by @Gedochao in #4261

Fixes

  • Prevent duplicate publish.credentials and repositories.credentials from being saved to the config database by @Gedochao in #4257

Build and internal changes

  • Fix scala-cli-archive-keyring.gpg generation; auto generate KEY.gpg for scala-cli-packages by @Gedochao in #4238
  • Fix sclicheck.GifTests.complete-install timing out by @Gedochao in #4236
  • Split the update-packages CI job down into individual targets by @Gedochao in #4259
  • Add explicit overrides in ScalaCliScalafixModule by @Gedochao in #4267

Documentation changes

  • Fix docs & add tests for repositories.mirrors & repositories.default by @Gedochao in #4235

Updates

  • Update scala-cli.sh launcher for 1.13.0 by @github-actions[bot] in #4232
  • Bump @algolia/client-search from 5.50.1 to 5.50.2 in /website in the npm-dependencies group by @dependabot[bot] in #4242
  • Bump @algolia/client-search from 5.50.2 to 5.51.0 in /website in the npm-dependencies group by @dependabot[bot] in #4247
  • Bump postcss from 8.5.6 to 8.5.12 in /website by @dependabot[bot] in #4248
  • Bump the npm-dependencies group in /website with 5 updates by @dependabot[bot] in #4251
  • Bump Mill to 1.1.6 (was 1.1.5) by @Gedochao in #4254
  • Bump Scala Native to 0.5.11 (was 0.5.10) by @Gedochao in #4253
  • Bump Scala 3 Next RC to 3.8.4-RC2 by @Gedochao in #4243
  • Bump fast-uri from 3.1.0 to 3.1.2 in /website by @dependabot[bot] in #4263
  • Bump @babel/plugin-transform-modules-systemjs from 7.28.5 to 7.29.4 in /website by @dependabot[bot] in #4264
  • Bump the npm-dependencies group in /website with 3 updates by @dependabot[bot] in #4265
  • Bump Typelevel Toolkit to 0.2.0 and enable it for Scala Native 0.5.* by @Gedochao in #4244
  • Bump Scala toolkit to 0.9.2 (was 0.8.0) by @Gedochao in #4268
  • Bump coursier to 2.1.25-M25 by @Gedochao in #4266

Full Changelog: v1.13.0...v1.14.0

v1.13.0

Choose a tag to compare

@Gedochao Gedochao released this 15 Apr 12:08
ed37d80

Change default Scala version to 3.8.3

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

scala-cli version
# Scala CLI version: 1.13.0
# Scala version (default): 3.8.3

Added by @Gedochao in #4204

Support for Scala.js 1.21.0

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

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

Added by @Gedochao in #4229

Ammonite REPL deprecated & scheduled for removal

The Ammonite-backed REPL integration is now deprecated and planned for removal (in sync with Ammonite's official communication).
Flags such as --ammonite, --ammonite-version, and --ammonite-arg on scala-cli repl will go away in a future release.

It's time to move on to the default Scala REPL.

Added by @Gedochao in #4218

java-test-runner for pure Java tests

Projects with only Java sources (no Scala in the build) now use a dedicated java-test-runner module when running scala-cli test.
The new runner wires up Java-friendly test frameworks (such as JUnit via junit-interface) without pulling the Scala test runner or Scala itself onto the test classpath.

//> using test.dep junit:junit:4.13.2
//> using test.dep com.novocode:junit-interface:0.11
import org.junit.Test;
import static org.junit.Assert.assertEquals;

public class JavaTestRunnerExample {
  @Test
  public void foo() {
    assertEquals(4, 2 + 2);
  }
}

Added by @Gedochao in #4197

GraalVM native-image packaging: packaging.graalvmJvmId and packaging.graalvmArgs

GraalVM native-image packaging JVM id and args are now configurable from using directive level.

//> using packaging.packageType graalvm
//> using packaging.graalvmJvmId graalvm-community:23.0.2
//> using packaging.graalvmArgs --no-fallback

Added by @zrhmn in #4223 & #4225

Features

  • Add java-test-runner module to support running tests with pure Java by @Gedochao in #4197
  • Support -opt-inline:help by @Gedochao in #4215
  • Add directive packaging.graalvmJvmId by @zrhmn in #4223
  • Add additional packaging.graalvm* directives by @zrhmn in #4225

Deprecations

  • Add proper deprecation logic for features & deprecate Ammonite for removal by @Gedochao in #4218

Fixes

  • Add signed-by support to Debian APT repository by @Gedochao in #4207
  • Add missing attributes to ivy2 publishing by @Gedochao in #4203
  • Fix misc compiler warnings by @Gedochao in #4220
  • Make each packaged native image use its own subdirectory under nativeImageWorkDir when cross-packaging by @Gedochao in #4221
  • Support formatting .sbt inputs by @Gedochao in #4195

Build and internal changes

  • Skip CI steps irrelevant to committed changes on PRs by @Gedochao in #4208
  • Run tests with JDK 26 by @Gedochao in #4214
  • Split release_notes.md into a separate test per-release-tag in docs-tests by @Gedochao in #4216

Updates

  • Update scala-cli.sh launcher for 1.12.5 by @github-actions[bot] in #4191
  • Bump Scala 3 Next RC to 3.8.3-RC3 by @Gedochao in #4194
  • Bump dorny/test-reporter from 2 to 3 in the github-actions group by @dependabot[bot] in #4198
  • Bump picomatch from 2.3.1 to 2.3.2 in /website by @dependabot[bot] in #4200
  • Bump node-forge from 1.3.3 to 1.4.0 in /website by @dependabot[bot] in #4202
  • Bump Scala 3 Next to 3.8.3 by @Gedochao in #4204
  • Bump brace-expansion from 1.1.12 to 1.1.13 in /website by @dependabot[bot] in #4205
  • Bump @algolia/client-search from 5.49.2 to 5.50.0 in /website in the npm-dependencies group by @dependabot[bot] in #4206
  • Bump the npm-dependencies group in /website with 2 updates by @dependabot[bot] in #4211
  • Bump lodash from 4.17.23 to 4.18.1 in /website by @dependabot[bot] in #4212
  • Bump Scala 3 Next RC to 3.8.4-RC1 by @Gedochao in #4213
  • Bump Mill to 1.1.5 (was 1.1.3) by @Gedochao in #4217
  • Bump the npm-dependencies group in /website with 6 updates by @dependabot[bot] in #4226
  • Bump follow-redirects from 1.15.11 to 1.16.0 in /website by @dependabot[bot] in #4227
  • Bump announced Scala 3 Next RC version to 3.8.4-RC1 by @Gedochao in #4219
  • Bump scalafmt to 3.11.0 (was 3.10.7) by @Gedochao in #4228
  • Bump Scala.js to 1.21.0 by @Gedochao in #4229

New Contributors

Full Changelog: v1.12.5...v1.13.0

v1.12.5

Choose a tag to compare

@Gedochao Gedochao released this 19 Mar 06:08
1491ac3

--cross support for run, package and doc sub-commands (experimental ⚡️)

It is now possible to cross-run, cross-package and cross-generate docs (doc) with the --cross command line
option.

  • run runs each configured combination of Scala version and platform (e.g. JVM, Native, JS) in sequence;
  • package produces one artifact per cross build, with the Scala version and platform in the artifact name;
  • doc generates Scaladoc for each cross target into separate output directories.
//> using scala 3.3 3.8
@main def main() = println("Hello")
scala-cli run cross.scala --cross --power
scala-cli package cross.scala --cross --power
scala-cli doc cross.scala --cross -o doc-out --power

Added by @Gedochao in #3808, #4171 & #4183

Global --offline config key

You can set offline mode globally with the config sub-command, so Scala CLI uses the cache and skips network access
without passing --offline every time.

scala-cli config offline true

Added by @Gedochao in #3216

Watch extra paths with --watching (experimental ⚡️)

Use the --watching option or //> using watching to have --watch re-run when files or directories outside
your sources change (e.g. config or assets).

scala-cli run . --watch --power --watching ./config --watching ./assets

Or in source:

//> using watching ./config ./assets

Added by @Gedochao in #4174

Local .m2 in publish local (experimental ⚡️)

publish local now publishes to your local Maven repository (~/.m2), so other local projects can depend
on the published artifacts via Maven coordinates.

scala-cli publish local . --m2 --power

Added by @Gedochao in #4179

Features

Fixes

  • Use Java 17 mapping when generating docs with Scala 3.8+ with doc by @Gedochao in #4180
  • Make test framework discovery on Native more resilient & with better errors by @Gedochao in #4185
  • Warn when .java & .scala sources are used in a mixed compilation with --server=false by @Gedochao in #4181

Build and internal changes

Updates

  • Bump the npm-dependencies group in /website with 3 updates by @dependabot[bot] in #4165
  • Bump the github-actions group with 3 updates by @dependabot[bot] in #4164
  • Update scala-cli.sh launcher for 1.12.4 by @github-actions[bot] in #4166
  • Bump svgo from 3.3.2 to 3.3.3 in /website by @dependabot[bot] in #4168
  • Bump immutable from 5.1.4 to 5.1.5 in /website by @dependabot[bot] in #4167
  • Bump Mill to 1.1.3 (was 1.1.2) by @Gedochao in #4169
  • Bump @algolia/client-search from 5.49.1 to 5.49.2 in /website in the npm-dependencies group by @dependabot[bot] in #4173
  • Bump the github-actions group with 4 updates by @dependabot[bot] in #4172
  • Update Scala 3 Next RC to 3.8.3-RC2 by @Gedochao in #4175
  • Bump undici from 7.18.2 to 7.24.1 in /website by @dependabot[bot] in #4182
  • Bump webfactory/ssh-agent from 0.9.1 to 0.10.0 in the github-actions group by @dependabot[bot] in #4187
  • Bump coursier to 2.1.25-M24 by @Gedochao in #4184
  • Bump sass from 1.97.3 to 1.98.0 in /website in the npm-dependencies group by @dependabot[bot] in #4188

Full Changelog: v1.12.4...v1.12.5

v1.12.4

Choose a tag to compare

@Gedochao Gedochao released this 03 Mar 09:35
ca3f6e8

This is just a small patch fixing a bug (#4152) breaking Metals support in Scala CLI v1.12.3.

Fixes

  • Fix BSP buildTarget/wrappedSources for GraalVM native image by @Gedochao in #4153

Documentation changes

Updates

  • Update scala-cli.sh launcher for 1.12.3 by @github-actions[bot] in #4151

Full Changelog: v1.12.3...v1.12.4

v1.12.3

Choose a tag to compare

@Gedochao Gedochao released this 25 Feb 23:54
d18e13d

Change default Scala version to 3.8.2

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

scala-cli version
# Scala CLI version: 1.12.3
# Scala version (default): 3.8.2

Added by @Gedochao in #4143

Fixes

  • Restore Scala 2 nightlies by @Gedochao in #4140
  • Fix Scala version validation to accept locally built compiler by @Gedochao in #4141
  • Ensure Scala CLI correctly refers to the latest Scala 2.12/2.13 nightly and recovers from errors by @Gedochao in #4142
  • Restore GraalVM image support for older CPUs by @Gedochao in #4150

Build and internal changes

Documentation changes

Updates

New Contributors

Full Changelog: v1.12.2...v1.12.3

v1.12.2

Choose a tag to compare

@tgodzik tgodzik released this 05 Feb 23:36
5e42e93

Old sonatype snapshot is causing Scala CLI to timeout

Until the recent migration to new Sonatype Central repository there was an older snapshots repository in use. Unfortuntately, last week it started to make requests to it timeout and hang Scala CLI. We decided remove any references to the old repository, so older (one might say ancient) Scala CLI nightly versions will not be available. This was done by @tgodzik in #4106.

Updates

Full Changelog: v1.12.1...v1.12.2

v1.12.1

Choose a tag to compare

@Gedochao Gedochao released this 27 Jan 15:33
97e58b3

Change default Scala version to 3.8.1

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

scala-cli version
# Scala CLI version: 1.12.1
# Scala version (default): 3.8.1

Added by @Gedochao in #4065

Change default Scala Native version to 0.5.10

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

scala-cli -e 'println("Hello from Scala Native 0.5.10!")' --native
# Compiling project (Scala 3.8.1, Scala Native 0.5.10)
# Compiled project (Scala 3.8.1, Scala Native 0.5.10)
# [info] Linking (multithreadingEnabled=detect) (725 ms)
# [info] Discovered 903 classes and 5554 methods after classloading
# [info] Checking intermediate code (quick) (31 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) (273 ms)
# [info] Discovered 512 classes and 2629 methods after classloading
# [info] Checking intermediate code (quick) (7 ms)
# [info] Discovered 493 classes and 2002 methods after optimization
# [info] Optimizing (debug mode) (447 ms)
# [info] Produced 12 LLVM IR files
# [info] Generating intermediate code (826 ms)
# [info] Compiling to native code (5461 ms)
# [info] Linking with [pthread, dl, m]
# [info] Linking native code (immix gc, none lto) (257 ms)
# [info] Postprocessing (0 ms)
# [info] Total (7688 ms)
# Hello from Scala Native 0.5.10!

Added by @Gedochao in #4078

Fixes

Build and internal changes

Updates

New Contributors

Full Changelog: v1.12.0...v1.12.1

v1.12.0

Choose a tag to compare

@Gedochao Gedochao released this 15 Jan 17:32
459a2a1

Change default Scala version to 3.8.0

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

scala-cli version
# Scala CLI version: 1.12.0
# Scala version (default): 3.8.0

Added by @Gedochao in #4049

Support for Scala.js 1.20.2

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

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

Added by @Gedochao in #4040

New aliases for RC and nightly Scala versions

This Scala CLI version introduces dedicated aliases for calling the latest Scala Release Candidate versions in a given series (including LTS).

scala-cli -e 'println(scala.util.Properties.versionNumberString)' -S rc
# 3.8.1-RC1
scala-cli -e 'println(scala.util.Properties.versionNumberString)' -S 3.rc
# 3.8.1-RC1
scala-cli -e 'println(scala.util.Properties.versionNumberString)' -S 3.8.rc
# 3.8.1-RC1
scala-cli -e 'println(dotty.tools.dotc.config.Properties.simpleVersionString)' -S 3.lts.rc --with-compiler
# 3.3.7-RC2
scala-cli -e 'println(dotty.tools.dotc.config.Properties.simpleVersionString)' -S lts.rc --with-compiler
# 3.3.7-RC2

Dedicated default and LTS nightly aliases are also provided.

scala-cli -e 'println(scala.util.Properties.versionNumberString)' -S nightly
# 3.8.2-RC1-bin-20260115-6151803-NIGHTLY
scala-cli -e 'println(dotty.tools.dotc.config.Properties.simpleVersionString)' -S lts.nightly --with-compiler
# 3.3.8-RC1-bin-20260112-d35b2d4-NIGHTLY-git-d35b2d4
scala-cli -e 'println(dotty.tools.dotc.config.Properties.simpleVersionString)' -S 3.lts.nightly --with-compiler
# 3.3.8-RC1-bin-20260112-d35b2d4-NIGHTLY-git-d35b2d4

Also note that there is no easy way to identify an RC for Scala 2 / 2.12 / 2.13 (as a particular nightly serves as the RC for those Scala distributions).
A reasonable error is also provided when it is requested.

scala-cli -e 'println(scala.util.Properties.versionNumberString)' -S 2.rc
# Invalid Scala version: 2.rc. In the case of Scala 2, a particular nightly version serves as a release candidate.
scala-cli -e 'println(scala.util.Properties.versionNumberString)' -S 2.12.rc
# Invalid Scala version: 2.12.rc. In the case of Scala 2, a particular nightly version serves as a release candidate.
scala-cli -e 'println(scala.util.Properties.versionNumberString)' -S 2.13.rc
# Invalid Scala version: 2.13.rc. In the case of Scala 2, a particular nightly version serves as a release candidate.

Added by @Gedochao in #4042 and #4016

(⚡️ experimental) Support for exporting to Mill 1.0.x and overriding the Mill version with --mill-version

The export sub-command now allows to export to Mill 1.0.x projects.

@main def main() = println("Let's export to Mill 1.0.6!")
scala-cli export mill-1-0-6-export.scala --mill --mill-version 1.0.6 --power
# Exporting to a mill project...
# Exported to: ~/mill-export/dest

Added by @Gedochao in #4028

Features & improvements

  • Add rc & *.rc Scala version aliases by @Gedochao in #4016
  • Support export-ing to Mill 1.x.y & allow to override Mill version with --mill-version by @Gedochao in #4028
  • Improve Scala nightly version handling & add lts.nightly, 3.lts.nightly and nightly Scala version tags by @Gedochao in #4042

Fixes

  • Fix Scala 3.nightly and 3.latest-minor.nightly to consistently point to the same version by @Gedochao in #4014
  • fix #4005 - Windows native-image compile failure caused by SUBST collision by @philwalk in #4006

Documentation changes

  • Solve docs' website warnings by @Gedochao in #4007
  • Back port of documentation changes to main by @github-actions[bot] in #4015

Build and internal changes

  • Enable Scala Native tests with the test command on Scala 3 by @Gedochao in #4018
  • Self-contained docker build with ARM64 publishing by @keynmol in #3962

Updates

Full Changelog: v1.11.0...v1.12.0

v1.11.0

Choose a tag to compare

@Gedochao Gedochao released this 12 Dec 06:43
4832457

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