Skip to content

Commit f289e12

Browse files
authored
Merge pull request VirtusLab#3541 from Gedochao/release/v1.7.0
Add release notes for `v1.7.0`
2 parents ce80e6c + 3110f24 commit f289e12

File tree

2 files changed

+175
-6
lines changed

2 files changed

+175
-6
lines changed

.github/release/release-procedure.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
- [ ] Wait for the `Update dist` PR to be automatically created after the previous one has been merged, and then
2525
proceed to merge it.
2626
- [ ] Make a release with the updated Scala CLI version.
27-
- [ ] Update the `v1` & `v1.6` tags to the latest release commit.
27+
- [ ] Update the `v1` & `v1.7` tags to the latest release commit.
2828
```bash
2929
git fetch --all
30-
git checkout origin v1.6.x
31-
git tag -d v1.6
32-
git tag v1.6
33-
git push origin v1.6 -f
30+
git checkout origin v1.7.x
31+
git tag -d v1.7
32+
git tag v1.7
33+
git push origin v1.7 -f
3434
git tag -d v1
3535
git tag v1
3636
git push origin v1 -f

website/docs/release_notes.md

+170-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,175 @@ import ReactPlayer from 'react-player'
88

99
# Release notes
1010

11+
## [v1.7.0](https://github.com/VirtusLab/scala-cli/releases/tag/v1.7.0)
12+
13+
### Switch to `scalameta/scalafmt` images of `scalafmt` 3.9.1+
14+
15+
Since version 3.9.1 `scalafmt` ships with native images built with Scala Native. As a result,
16+
we are sunsetting https://github.com/virtuslab/scalafmt-native-image and Scala CLI will use the artifacts
17+
from https://github.com/scalameta/scalafmt for `scalafmt` versions >=3.9.1
18+
19+
Note that older Scala CLI versions may still attempt to download a native image from the old repository for the new versions.
20+
We will keep releasing those for a short while to help late upgraders migrate.
21+
22+
```bash
23+
scala-cli fmt -F -version
24+
# scalafmt 3.9.2
25+
```
26+
27+
Added by [@Gedochao](https://github.com/Gedochao) in [#3521](https://github.com/VirtusLab/scala-cli/pull/3521)
28+
29+
### Support the `--test` command line option for `run` and `package`
30+
31+
It is now possible to `run` a main method from the test scope with the `--test` flag.
32+
33+
```scala title=HelloFromTestScope.scala
34+
//> using target.scope test
35+
@main def helloFromTestScope(): Unit = println("Hello from the test scope!")
36+
```
37+
38+
```bash
39+
scala-cli run HelloFromTestScope.scala --test --power
40+
41+
# Hello from the test scope!
42+
```
43+
44+
Similarly, it is now possible to `package` the main and test scopes together, using the same `--test` flag.
45+
46+
```bash
47+
scala-cli package HelloFromTestScope.scala --test --power
48+
# # Wrote /Users/pchabelski/IdeaProjects/scala-cli-tests-2/untitled/v170/helloFromTestScope, run it with
49+
# ./helloFromTestScope
50+
./helloFromTestScope
51+
# Hello from the test scope!
52+
```
53+
54+
Keep in mind that the test and main scopes are still separate compilation units, where the test scope depends on the main scope (while the reverse isn't true).
55+
56+
Added by [@Gedochao](https://github.com/Gedochao) in [#3502](https://github.com/VirtusLab/scala-cli/pull/3502) and [#3519](https://github.com/VirtusLab/scala-cli/pull/3519)
57+
58+
### Detect objects with main class in scripts
59+
60+
Scala CLI now detects objects with a main method in scripts and runs them by default.
61+
62+
```scala title=scriptMainObject.sc
63+
object Main {
64+
def main(args: Array[String]): Unit = println("Hello")
65+
}
66+
```
67+
68+
Do note that, this is chiefly a convenience feature for migration of old scripts, using the old, legacy `scala` runner.
69+
70+
If any top-level code is present alongside an object with a main method, the top-level code will be run instead and a warning printed.
71+
72+
```scala title=scriptWithMainObjectAndTopLevel.sc
73+
object Main {
74+
def main(args: Array[String]): Unit = println("Hello")
75+
}
76+
println("Top level code says hello")
77+
```
78+
79+
```bash
80+
scala-cli run scriptWithMainObjectAndTopLevel.sc
81+
# [warn] Script contains objects with main methods and top-level statements, only the latter will be run.
82+
# Compiling project (Scala 3.6.3, JVM (23))
83+
# Compiled project (Scala 3.6.3, JVM (23))
84+
# Top level code says hello
85+
```
86+
87+
Additionally, cases where multiple main methods are present in the same script are not supported, inidicated by a warning.
88+
89+
```scala title=scriptWithMultipleMainObjects.sc
90+
object Main {
91+
def main(args: Array[String]): Unit = println("Hello1")
92+
}
93+
94+
object Main2 {
95+
def main(args: Array[String]): Unit = println("Hello2")
96+
}
97+
```
98+
99+
Note that no output is printed in this example:
100+
101+
```bash
102+
scala-cli run scriptWithMultipleMainObjects.sc
103+
# [warn] Only a single main is allowed within scripts. Multiple main classes were found in the script: Main, Main2
104+
# Compiling project (Scala 3.6.3, JVM (23))
105+
# Compiled project (Scala 3.6.3, JVM (23))
106+
```
107+
108+
Finally, main methods defined in this way cannot be chosen via the `--main-class` command line option directive,
109+
and neither will they be printed by the `--list-main-methods` flag.
110+
111+
Added by [@tgodzik](https://github.com/tgodzik) in [#3479](https://github.com/VirtusLab/scala-cli/pull/3479)
112+
113+
### Support for Scala Native 0.5.7
114+
This Scala CLI version switches the default Scala Native version to 0.5.7.
115+
116+
```bash
117+
scala-cli -e 'println("Hello from Scala Native 0.5.7!")' --native
118+
# Compiling project (Scala 3.6.3, Scala Native 0.5.7)
119+
# Compiled project (Scala 3.6.3, Scala Native 0.5.7)
120+
# [info] Linking (multithreadingEnabled=true, disable if not used) (1045 ms)
121+
# [info] Discovered 915 classes and 5608 methods after classloading
122+
# [info] Checking intermediate code (quick) (41 ms)
123+
# [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.
124+
# [info] Linking (multithreadingEnabled=false) (352 ms)
125+
# [info] Discovered 498 classes and 2506 methods after classloading
126+
# [info] Checking intermediate code (quick) (9 ms)
127+
# [info] Discovered 477 classes and 1930 methods after optimization
128+
# [info] Optimizing (debug mode) (608 ms)
129+
# [info] Produced 9 LLVM IR files
130+
# [info] Generating intermediate code (650 ms)
131+
# [info] Compiling to native code (1674 ms)
132+
# [info] Linking with [pthread, dl, m]
133+
# [info] Linking native code (immix gc, none lto) (339 ms)
134+
# [info] Postprocessing (0 ms)
135+
# [info] Total (4655 ms)
136+
# Hello from Scala Native 0.5.7!
137+
```
138+
139+
Added in [#3527](https://github.com/VirtusLab/scala-cli/pull/3527)
140+
141+
### Features
142+
* improvement: Detect objects with main class in scripts by [@tgodzik](https://github.com/tgodzik) in [#3479](https://github.com/VirtusLab/scala-cli/pull/3479)
143+
* Add support for running a main method from the test scope by [@Gedochao](https://github.com/Gedochao) in [#3502](https://github.com/VirtusLab/scala-cli/pull/3502)
144+
* Support the `--test` flag with the `package` sub-command by [@Gedochao](https://github.com/Gedochao) in [#3519](https://github.com/VirtusLab/scala-cli/pull/3519)
145+
146+
### Fixes
147+
* Improve handling for parallel Scala CLI runs by [@Gedochao](https://github.com/Gedochao) in [#3399](https://github.com/VirtusLab/scala-cli/pull/3399)
148+
* fix: Don't compile docs if there is no need by [@ghostbuster91](https://github.com/ghostbuster91) in [#3503](https://github.com/VirtusLab/scala-cli/pull/3503)
149+
* fix: correctly report error position on unknown directive without values by [@kasiaMarek](https://github.com/kasiaMarek) in [#3518](https://github.com/VirtusLab/scala-cli/pull/3518)
150+
151+
### Internal and build changes
152+
* fix for #3510 by [@philwalk](https://github.com/philwalk) in [#3513](https://github.com/VirtusLab/scala-cli/pull/3513)
153+
* Fall back to the `cs` command on `PATH` in the `mill` script by [@Gedochao](https://github.com/Gedochao) in [#3517](https://github.com/VirtusLab/scala-cli/pull/3517)
154+
155+
### Documentation changes
156+
* Curl install launcher in your repo by [@joan38](https://github.com/joan38) in [#3532](https://github.com/VirtusLab/scala-cli/pull/3532)
157+
158+
### Updates
159+
* Update scala-cli.sh launcher for 1.6.2 by [@github-actions](https://github.com/github-actions) in [#3495](https://github.com/VirtusLab/scala-cli/pull/3495)
160+
* Update metaconfig-typesafe-config to 0.15.0 by [@scala-steward](https://github.com/scala-steward) in [#3497](https://github.com/VirtusLab/scala-cli/pull/3497)
161+
* Update bloop-config_2.13 to 2.3.2 by [@scala-steward](https://github.com/scala-steward) in [#3496](https://github.com/VirtusLab/scala-cli/pull/3496)
162+
* Update semanticdb-shared_2.13 to 4.13.0 by [@scala-steward](https://github.com/scala-steward) in [#3500](https://github.com/VirtusLab/scala-cli/pull/3500)
163+
* Update ammonite to 3.0.2 by [@scala-steward](https://github.com/scala-steward) in [#3504](https://github.com/VirtusLab/scala-cli/pull/3504)
164+
* Update semanticdb-shared_2.13 to 4.13.1.1 by [@scala-steward](https://github.com/scala-steward) in [#3508](https://github.com/VirtusLab/scala-cli/pull/3508)
165+
* Update scalafix-interfaces to 0.14.1 by [@scala-steward](https://github.com/scala-steward) in [#3511](https://github.com/VirtusLab/scala-cli/pull/3511)
166+
* Update semanticdb-shared_2.13 to 4.13.2 by [@scala-steward](https://github.com/scala-steward) in [#3515](https://github.com/VirtusLab/scala-cli/pull/3515)
167+
* Update scalafix-interfaces to 0.14.2 by [@scala-steward](https://github.com/scala-steward) in [#3514](https://github.com/VirtusLab/scala-cli/pull/3514)
168+
* Update slf4j-nop to 2.0.17 by [@scala-steward](https://github.com/scala-steward) in [#3520](https://github.com/VirtusLab/scala-cli/pull/3520)
169+
* Bump Scala 3 Next RC to 3.6.4-RC2 by [@Gedochao](https://github.com/Gedochao) in [#3525](https://github.com/VirtusLab/scala-cli/pull/3525)
170+
* Update Scala Native to 0.5.7 by [@scala-steward](https://github.com/scala-steward) in [#3527](https://github.com/VirtusLab/scala-cli/pull/3527)
171+
* Bump `scala-packager` to 0.1.32 & linux CI runners to `ubuntu-24.04` by [@Gedochao](https://github.com/Gedochao) in [#3528](https://github.com/VirtusLab/scala-cli/pull/3528)
172+
* Update `scalafmt` to 3.9.1 by [@Gedochao](https://github.com/Gedochao) in [#3521](https://github.com/VirtusLab/scala-cli/pull/3521)
173+
* Bump `scalafmt` to 3.9.2 by [@Gedochao](https://github.com/Gedochao) in [#3533](https://github.com/VirtusLab/scala-cli/pull/3533)
174+
* Bump gifs tests Ubuntu Docker image to `ubuntu:24.04` by [@Gedochao](https://github.com/Gedochao) in [#3534](https://github.com/VirtusLab/scala-cli/pull/3534)
175+
* Update sbt, scripted-plugin to 1.10.9 by [@scala-steward](https://github.com/scala-steward) in [#3537](https://github.com/VirtusLab/scala-cli/pull/3537)
176+
* Bump Linux ARM64 Docker image to `ubuntu:24.04` by [@Gedochao](https://github.com/Gedochao) in [#3535](https://github.com/VirtusLab/scala-cli/pull/3535)
177+
178+
**Full Changelog**: https://github.com/VirtusLab/scala-cli/compare/v1.6.2...v1.7.0
179+
11180
## [v1.6.2](https://github.com/VirtusLab/scala-cli/releases/tag/v1.6.2)
12181

13182
### Support for Scala.js 1.18.2
@@ -238,7 +407,7 @@ Added by [@Vigorge](https://github.com/Vigorge) and [@dos65](https://github.com/
238407
### Support for running snapshot versions of the build server (Bloop)
239408
It is now possible to pass a snapshot version to the `--bloop-version` command line option.
240409

241-
```bash
410+
```bash ignore
242411
scala-cli compile . --bloop-version 2.0.7-8-fe3f53d9-SNAPSHOT
243412
# Starting compilation server
244413
# Compiling project (Scala 3.6.3, JVM (23))

0 commit comments

Comments
 (0)