Releases: VirtusLab/scala-cli
v0.1.2
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
- @zmerr become a member of the core team
- @Quafadas made their first contribution in #595
- @ghostbuster91 made their first contribution in #639
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)
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
- Prepare to build CLI with Scala 2.13 by @alexarchambault in #665
- Automate releases to SDKMAN by @lwronski #657
- Fix formatting in Scala CLI on Windows command prompt by @alexarchambault in #675
- Stop reading global bloop config by @lwronski in #672
- Provide proper logger for using directives plus Tweaking by @alexarchambault in #618
- Generate only one build target for main and test scope by @lwronski in #550
- Fix #588: fmt --check not being passed to scalafmt by @jchyb in #600
- Fix project import in Intellij. Support for Intellij still depends on project structure and in many cases may not work regardless of this fix by @romanowski in #608
- Allow users to specify an explicit workspace directory by @alexarchambault in #679
Merged PR
- Fix - define multiple times scalac options with -P and Xplugin prefix by @lwronski in #653
- Allow to disable Bloop file content comparison by @alexarchambault in #666
- Skip set posix file permissions in windows by @lwronski in #671
- Don't compute "hash data" for options that are not used by Bloop by @alexarchambault in #648
- Fix Scala Native directory project caching by @jchyb in #641
- Better Scala.JS and Scala Native logging during tests by @alexarchambault in #668
- More lightweight coursier logging by @alexarchambault in #667
- Passes a logger taking into account verbosity to the Scala.JS linker by @alexarchambault in #673
- Fix generate help for shebang by @lwronski in #616
- Prepare build to windows-2022 GitHub action image by @alexarchambault in #585
- Use HttpURLConnection to download files by @lwronski in #590
- Add docker-based sudo test by @alexarchambault in #605
- Lock millw script commit in export command by @alexarchambault in #628
- Renaming default branch to main by @lwronski in #630
Documentation changes
- made demo.gif show a simple scripting sample first by @zmerr in #658
- Release procedure by @lwronski in #587
- Minor documentation editorial changes by @Quafadas in #595
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
v0.1.1
This release focuses on stability.
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)
Suport for SDK
Scala CLI will be available on SDKMAN soon. From now on, Scala CLI generates packages that are supported by SDKMAN.
This change was introduced @lwronski in #609 .
New Contributors
Thank you!
Notable changes
- Provide proper logger for using directives plus Tweaking by @alexarchambault in #618
- Generate only one build target for main and test scope by @lwronski in #550
- Fix #588: fmt --check not being passed to scalafmt by @jchyb in #600
- Fix project import in Intellij. Support for Intellij still depends on project structure and in many cases may not work regardless of this fix by @romanowski in #608
Merged PRs
- Fix generate help for shebang by @lwronski in #616
- Prepare build to windows-2022 GitHub action image by @alexarchambault in #585
- Use HttpURLConnection to download files by @lwronski in #590
- Add docker-based sudo test by @alexarchambault in #605
- Lock millw script commit in export command by @alexarchambault in #628
- Renaming default branch to main by @lwronski in #630
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.1
these are:
15 Alexandre Archambault
12 Łukasz Wroński
7 Krzysztof Romanowski
5 zmerr
3 Jan Chyb
1 Simon Parten
Full Changelog: v0.1.0...v0.1.1
v0.1.0
This is the first release that contains breaking changes (within using directives) since the project became public. We want to thank our users for all the warm reception we see over various channels, all bug reports and suggestions. With such support, developing Scala CLI is a real pleasure.
New Contributors
- @jchyb become a member of the core team, with focus on Scala Native and scripting
- @mpkocher made their first contribution in #514
- @lolgab made their first contribution in #581
Thank you!
New syntax for using directives
This release brings a lot of changes within using directives.
Firstly, our internal parser for using directives was retired in favor of using_directives library. The using directives grammar has been cleaned up. From this release, using directives values need to be a valid Scala primitives namely numbers, booleans or strings. @pikinier20 has concluded that effort in #364
We have changed the syntax further, namely:
- using directives in plain comments (
// using foo bar
and/* using foo bar */
) is deprecated - annotation syntax for using directives is deprecated (
@using
) - we are introducing special comments for using directives using
>
://> using foo bar
and/*> using foo bar */
Old syntaxes will still work in 0.1.x
releases but will result in warnings like this one:
[warn] ./a.scala:2:1: This using directive is ignored. Using directive using plain comments are deprecated. Please use a special comment syntax: '//> ...' or '/*> ... */'
[warn] // using options "-Xasync"
[warn] ^^^
This change was introduced by @romanowski in #546.
Scala CLI now uses its own bloop instance
Using a global bloop server is not ideal, since it limits our control on used options or JVM. In the past, we've also had some conflicts with Metals managing that server. Bloop has potential security vulnerabilities when using Scala CLI within multi-user environments and for that we wanted to switch our communication with bloop so it use named pipes rather than sockets. That is why we decided that Scala CLI should use its own dedicated bloop sever that is fully controlled by us.
@alexarchambault made the required changes in bloop that lives in our fork until they are merged upstream (we do not plan to maintain that fork for long). Also, we decided to run our bloop on Java 17. That work resulted in following PRs: #469, #508, #507 and #529.
Having a dedicated bloop sever increased consumed resources, mainly the memory. To reduce that impact @tpasternak analyzed (#515) usage of different garbage collectors so our bloop server can release memory back to OS when unused. ZGC
offers the best performance so it was used by default in our bloop server in #553.
Redesign of Scala Native support
In order to decouple Scala CLI from specific versions of Scala Native, Scala Native CLI was created and used within Scala CLI to build Scala Native applications. Scala CLI can now easily support multiple versions of Scala Native, including future releases without a need to release Scala CLI. Scala CLI supports Scala Native 0.4.3
so it is possible to use Scala Native with Scala 3.
@jchyb co-created Scala Native CLI and introduced it into Scala CLI in: #527, #449 and #554
Scala CLI can be run with specific version or using latest snapshot
Since 0.1.0
it is possible to specify in command line a specific version of Scala CLI. It is also possible to use the latest snapshot. It will use the JVM-based launcher and this will come with overhead needed to start JVM for each scala-cli usage.
This feature is also compatible with SheBang header in Scala Script:
#!/usr/bin/env -S scala-cli --cli-version 0.0.9+131-gf0ab5c40-SNAPSHOT shebang
println(args(1))
This feature was added by @lwronski in #548 .
Improve handling of automatically-resolved versions
Until now, Scala CLI was using latest released Scala version that matches the input provided by users (e.g. 3
or 2.12
). As 2.13.7
showed us, small changes in the internals may break bloop or other parts of Scala CLI and with that break overnight applications or CIs. To avoid such a problem, @lwronski in #456 and #563 added support for predefined list of Scala versions per wildcard, defined in a file in a separate Scala CLI-controlled repository. We plan to update that list with all new Scala version that would work with Scala CLI given Scala CLI version.
This feature only applies to automatically-resolved versions so it is possible to provide any version of Scala even if it is not verified by the team.
Rename our build directory to .scala-build
We were using a directory called .scala
to store all build-related artifacts (.class files, bloop details etc.) and it was causing some confusion in Metals and messing up with searching for Scala sources in scripts. @alexarchambault changed that directory to .scala-build
in #573
We are also checking if the current user can access build directory and in case not we fall back to a global build directory within the user's home directory. This change allows Scala CLI to be run as a different user/root using sudo
and similar commands.
Scala CLI is used to verify code snippets in our repository
This is not related strictly to this release, but from some time (#562) we are using scala-cli to verify the snippets in reported issues using scala-cli based github action created by @lwronski
Improve handling of JVMs and Java sources
This release improves the way Scala CLI handles JVMs and Java sources so we decided to group all those issues together. Even though Scala CLI has Scala
in its name, it can be used to build Java-only projects.
The list is as follow:
- Generate semantic DBs for Java sources, pass wrapped sources details over BSP by @alexarchambault in #567
- Warn if jvm api cannot be used by @tpasternak in #447
- Workaround issue with empty JAVA_HOME by @alexarchambault in #475
- Native image: do not filter-out JVM options passed to scala-cli app by @tpasternak in #474
- Java properties set in using directives by @tpasternak in #493
- Bump default java to 11 by @tpasternak in #516
Other changes:
- In case of critical failures, safe stacktraces show error message and store full stacktrace in the file by @tpasternak in #461
- Add missing options and using directives related to Scala.js by @tpasternak and @lwronski in #492 and #539
- Accept zip as a input by @lwronski in #460
- Allow custom repositories for scala-library in repl by @tpasternak in #520
- Unify 'help' and 'version' commands by @tpasternak in #454
- Handling of failures and crashes within our BSP server was improved by @tpasternak and @romanowski in #471, #552 and #564
- Add help parameter to print specific options for ScalaNative and ScalaJS groups by @lwronski in #489
Bugfixes
- Fix #528: Non-default scalafmt version leading to errors by @jchyb in #545
- Ignore SIGPIPE on Linux by @alexarchambault in #503
- Default module kind to NoModule in ScalaJs by @ckipp01 in #342
- Ignore NoClassDefFoundError exception in test runner by @lwronski in #495
- Add log if someone try to run test without zio-test-sbt by @lwronski in #505
- Fix separator typo when installing shell completions by @mpkocher in #514
- Fix running on JS release mode by @romanowski in #522
- Fix - use resourcesDir in package command by @lwronski in #519
- Fix #525: Spuriously duplicate options by @jchyb in #536
- Include scope test in export to sbt by @lwronski in #523
- Report error if scala script not exists by @lwronski in #538
- Ignore main scope in test command by @lwronski in https...
v0.0.9
This release focuses on stability.
New scala-cli shebang
command
Change the way how scala-cli
parses it's command-line arguments in order to be compatibility with shebang
scripts. To see more go to shebang
section in documentation.
Added in #410, thanks to @tpasternak .
Zsh/Bash option completions
Fixed in #423, thanks to @lwronski to add escaping backticks in case-app.
Resources directory
Now, scala-cli accepts resource directory for Github Gists. Added in #415 . We change name of directive to specify resource directory from resource
-> resourceDir
#412.
Shebang in Scala file.
We support shebang
header in Scala file, added in #435.
Update
To update scala-cli use your package manager or, if you used an installation script before, run it again - curl -sSLf https://virtuslab.github.io/scala-cli-packages/scala-setup.sh | sh
.
Scala CLI is still far from being stable however within three realise Scala CLI is mostly feature-complete for 1.0 release.
Notable changes
- Allow shebangs and using directives in scala files by @lwronski in #435
- Run native linker only if project was changed by @lwronski in #372
- Accept resources in Github Gists by @lwronski in #415
- Issue: 331 Added directive for native-version, native-compile, native-linking by @asjad02 in #425
- Fix - zsh option completions - Update case-app to 2.1.0-M10 by @scala-steward in #423
- Issue 331 : Adding Directive for native-gc by @asjad02 in #398
- Rename resource -> resourceDir by @tpasternak in #412
- Add using directive for specifying a (default) main class by @fourth44 in #400
- Shebang args by @tpasternak in #410
Merged PRs
- Fix a bug inside UsingCompilerPluginDirectiveHandler by @pikinier20 in #361
- clean .bsp/scala-cli.json when you run clean by @ckipp01 in #369
- Don't unnecessarily pass native config around by @alexarchambault in #394
- Validate on CI that directive reference doc is up-to-date by @alexarchambault in #416
- Make sure buildServerCapabilities are set when the initialize happens by @ckipp01 in #417
- Handle bloop running on JRE by @tpasternak in #419
- Build scala-cli with jvm 11 by @tpasternak in #212
- Options validation by @tpasternak in #406
- Use artifacts from main scope in tests by @lwronski in #430
- Parse JVM 9 version correctly by @tpasternak in #439
Documentation changes
- Depoly documentation only from stable branch by @romanowski in #433
- Reviewed the Getting Started file by @alvinj in #428
- Use gifs in doc by @lwronski in #438
- Change community link to discord. by @ckipp01 in #424
- fix typo in ide.md by @tnielens in #427
- Documentation: Describe shebangs by @tpasternak in #418
- Add getting started guide by @romanowski in #367
- Add cookbook - Setup ScalaCLI project in VSCode by @lwronski in #363
New Contributors
- @pikinier20 made their first contribution in #361
- @asjad02 made their first contribution in #398
- @fourth44 made their first contribution in #400
- @tnielens made their first contribution in #427
Contributors
Thank you to all the contributors who made this release possible 🎉
According to git shortlog -sn --no-merges v0.0.8..v0.0.9
these are:
21 Scala Steward
13 Tomasz Pasternak
8 Łukasz Wroński
6 Alexandre Archambault
6 Krzysztof Romanowski
3 dependabot[bot]
3 Chris Kipp
3 asjad02
1 Tim Nielens
1 Asjad Baig
1 gh-actions
1 Johan Walters
1 Filip Zybała
1 Alvin Alexander
1 Marcin Aman
Full Changelog: v0.0.8...v0.0.9
0.0.8
This release focuses on stability and support for Metals (mainly in Visual Studio Code).
To update scala-cli
use your package manager or, if you used an installation script before, run it again - curl -sSLf https://virtuslab.github.io/scala-cli-packages/scala-setup.sh | sh
Scala CLI is still far from being stable however within three realise Scala CLI is mostly feature-complete for 1.0 release.
Notable changes
- Add compiler plugins directive by @romanowski in #273
- Add support for running test classes in Metals by @lwronski in #239
- Bloop compile to correct JVM version by @tpasternak in #217
- Publish scala-cli docker images with preloaded scala version by @lwronski (based on the work by @kubukoz) in #305
- Should not re-compile project after catching exception by @lwronski in #319
What's Changed
- Do not warn about top-level things in Scala repl by @romanowski in #287
- deps: bump Bloop to 1.4.10. by @ckipp01 in #276
- fix: stick to a tcp connection for Bloop on non-standard OS's. by @ckipp01 in #272
- Update bloop by @Romanowsk to support Scala
2.13.7
in #339 - Add command to updating
scala-cli
by @lwronski in #317 - Fix parsing bloop config - ignore error during parsing by @lwronski in #347
- Accept
//using
directive without a space by @lwronski in #358
Documentation changes
- Add documentation for
fmt
,setup-ide
andclean
by @MarcinAman in #249 - Add nix installation method on Mac/Linux by @kubukoz in #255
- Use more common example libraries by @SethTisue in #301
- Add search to docs by @MarcinAman in #304
- Fix links in documents by @takezoe in #321
- Check gifs on CI by @romanowski in #310
- Update nix instructions by @kubukoz in #348
New Contributors
- @KacperFKorban made their first contribution in #231
- @bjornregnell made their first contribution in #268
- @SethTisue made their first contribution in #301
- @alvinj made their first contribution in #277
- @takezoe made their first contribution in #321
Contributors
Thank you to all the contributors who made this release possible 🎉
According to git shortlog -sn --no-merges v0.0.7..v0.0.8
these are:
25 Łukasz Wroński
25 Krzysztof Romanowski
8 Tomasz Pasternak
4 Chris Kipp
4 Bjorn Regnell
4 Alvin Alexander
3 Marcin Aman
3 Jakub Kozłowski
2 Seth Tisue
2 Kacper Korban
1 Alexandre Archambault
1 Naoki Takezoe
Full Changelog: v0.0.7...v0.0.8
v0.0.7 - first usable version
This is the first version of Scala CLI that can be tested by the users.
Scala CLI is still far from being stable however within three realise Scala CLI is mostly feature-complete for 1.0 release.
v0.0.6
What's Changed
- [wip] Cli args in scripts by @tpasternak in #178
- Add standalone launcher for Scala CLI - Windows by @lwronski in #209
- Disable scala-cli installations via the snap by @lwronski in #208
- Merge scripting cookbooks by @tpasternak in #211
- Fix typo in one-line command and use last stable release scala-cli to install by @lwronski in #213
- Add cookbook for docker by @lwronski in #215
- Report errors for using directives in console and via BSP by @alexarchambault in #210
- Tweak doc and fix relative paths handling in using directives by @alexarchambault in #220
- Add brew to main page by @MarcinAman in #219
- Setup-ide should run before compile, run and test by @MarcinAman in #188
- Introduce defaults to os in install and shell by @MarcinAman in #222
- Add scala-js and scala-native installation by @romanowski in #216
- Pass default dialect to scalafmt by @alexarchambault in #223
- Download inputs each time by @tpasternak in #214
- Add support for running and debugging main classes in Metals by @lwronski in #221
- Update internals doc page by @alexarchambault in #224
Full Changelog: v0.0.5...v0.0.6
v0.0.5
What's Changed
- Refactor landing page and add pages for each usecase. by @romanowski in #151
- Add support for 'in' clause in require directives by @alexarchambault in #164
- Remove example with conf file by @lwronski in #169
- Add retry logic to docker packaging tests by @alexarchambault in #170
- Add back CNAME by @alexarchambault in #173
- Tweak build for aarch64 (raspberrypi 4) by @alexarchambault in #172
- Take into account JVM options defined in ~/.bloop/bloop.json by @tpasternak in #168
- Tweak CI by @alexarchambault in #177
- Pass arguments as is to shebang scripts by @alexarchambault in #175
- Fix CI - head_ref return empty string on master by @lwronski in #182
- Disable checking if the file already exists in docker package by @lwronski in #181
- Do not automatically cancel builds in master by @lwronski in #184
- Refactor static site by @romanowski in #187
- Fixes from Marta by @romanowski in #189
- Add cookbook - Test your code with java 8 by @lwronski in #179
- Update scala-packager to 0.1.24 by @lwronski in #190
- Enable some scalafmt rewrites by @alexarchambault in #171
- Better errors by @alexarchambault in #191
- Add cookbooks for package and scala scripts by @lwronski in #174
- Fix scalafmt / scalafix by @alexarchambault in #194
- Add test sources and cross-building support by @alexarchambault in #176
- Better handling of malformed import $ivy-s by @alexarchambault in #196
- Docs improvements by @MarcinAman in #195
- Turn cookbook recepies into examples by @romanowski in #165
- Rework page layout by @romanowski in #197
- Tweak build / address compiler warnings by @alexarchambault in #198
- Fix master build, and try to speed up type class derivations by @alexarchambault in #202
- Update coursier to 2.0.16-169-g194ebc55c by @alexarchambault in #203
- Run less tests on CI by @alexarchambault in #204
- Add proper demo gif by @romanowski in #199
- Add standalone launcher for Scala CLI - MacOs/Linux by @lwronski in #185
- Tweak directive parsing by @alexarchambault in #200
- Add more interactive install-home command by @lwronski in #186
- Add more gifs by @romanowski in #207
New Contributors
- @MarcinAman made their first contribution in #195
Full Changelog: v0.0.4...v0.0.5
v0.0.4
.
v0.0.3
.