Skip to content

v0.1.2

Compare
Choose a tag to compare
@lwronski lwronski released this 22 Feb 09:56
· 2687 commits to main since this release
784a7af

This release focuses on stability.

The last release of Scala CLI 0.1.1 introduced some regressions and we have decided not to announce it. This release notes is composed of both 0.1.1 and 0.1.2 releases.

New Contributors

Thank you!

Scala CLI now uses Java 17

From now, Scala CLI uses by default Java 17 to compile and run your scala code (changed by in #669)

Redesign Compile command

Until now, Scala CLI compiles the main and test scope if you run the following commands: run, package, compile and repl.

Since 0.1.2 the compile command is compiling only the main scope by default. If you want to compile also test scope, you should pass --test flag to compile command:

scala-cli compile --test [args]

package,repl and run commands by default compile only the main scope. This change was introduced in #638 by @lwronski.

Scala CLI can run nightly versions of Scala 2 and 3

Since 0.1.2 it is possible to use the latest nightly version of Scala compiler with the syntax 2.nightly and 3.nightly.

For compiling with the latest Scala 2 nightly build:

scala-cli Hello.scala -S 2.nightly

For compiling with the latest Scala 3 nightly build:

scala-cli Hello.scala -S 3.nightly

For compiling with a specific nightly build for Scala 2, you have to pass the full version:

scala-cli Hello.scala -S 2.13.9-bin-4505094 

It is also possible to use this syntax in using directives:

//> using scala "2.nightly"

This feature was added by @zmerr in #677.

Override using directives options

This release adds support to override scalac, java, and dependency options of using directives with CLI counterparts. Only specific values (a given dependency or java or scala option) are overridden, and the rest of the options are concatenated. In the following example:

$ cat Hello.scala
//> using lib "org.scalameta::munit::1.0.0-M1"
//> using lib "com.lihaoyi::os-lib:0.8.1"

$ scala-cli Hello.scala  --dependency "org.scalameta::munit::0.7.29" --dependency "io.spray::spray-http:1.3.4"

Scala CLI uses version 1.0.0-M1 of munit, along with os-lib and spray-http.

This feature allows overriding (downgrade) a value/dependency without modifying the source file (or when used with e.g. gists)

Thanks to @jchyb in #612

Suport for SDK

Scala CLI will be available on SDKMAN. From now, Scala CLI generates packages that are supported by SDKMAN.

This change was introduced in #609 .

Experimental support for using directives in Java files

in #639, @ghostbuster91 has implemented initial support for placing using directives within .java files as a part of Scala 3 issue spree framework with help from @mtk and @romanowski. The feature is still experimental and actual directives that will be supported and other details are subject to change in upcoming releases.

Notable changes

Merged PR

Documentation changes

Contributors

Thank you to all the contributors who made this release possible 🎉

According to git shortlog -sn --no-merges v0.1.0...v0.1.2 these are:

37  Alexandre Archambault
25  zmerr
16  Łukasz Wroński
9  Krzysztof Romanowski
5  ghostbuster91
4  Jan Chyb
1  Simon Parten
1  Kasper Kondzielski

Full Changelog: v0.1.0...v0.1.2