You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Require the `--power` option for restricted features by default
13
+
14
+
Until now, Scala CLI has been limiting some of its functionalities in its `scala` distribution.
15
+
Starting with `v0.2.0`, those limitation will be applied to all distributions, including `scala-cli`.
16
+
17
+
This was done in order to make the behaviour consistent with Scala CLI acting as the Scala runner.
18
+
19
+
Restricted features can be accessed by using the `--power` launcher flag. Do note that launcher flags have to be passed **before** the sub-command.
20
+
```bash ignore
21
+
scala-cli --power package .
22
+
```
23
+
Alternatively, the `power` mode can be turned on globally by running:
24
+
25
+
```bash ignore
26
+
scala-cli config power true
27
+
```
28
+
29
+
Please note that this change may affect your existing scripts or workflows that rely on the limited commands from ScalaCLI (such as `package`, `publish`). You can still use those commands with `power` mode enabled.
30
+
31
+
When you try to use a limited command in restricted mode, you will now see a warning message with suggestions on how to enable this command:
32
+
33
+
34
+
```bash ignore
35
+
$ scala-cli package Hello.scala
36
+
# This command is restricted and requires setting the `--power` option to be used.
37
+
# You can pass it explicitly or set it globally by running:
38
+
# scala-cli config power true
39
+
$ scala-cli config power true
40
+
$ scala-cli package Hello.scala
41
+
# Wrote Hello, run it with
42
+
# ./Hello
43
+
```
44
+
45
+
Added by [@lwronski](https://github.com/lwronski) in [#1835](https://github.com/VirtusLab/scala-cli/pull/1835) and [#1849](https://github.com/VirtusLab/scala-cli/pull/1849)
46
+
47
+
### Allow executable Scala scripts without a file extension
48
+
49
+
As of this release Scala scripts without the `*.sc` file extension will be supported for execution when using the `shebang` command.
50
+
51
+
```scala title=hello
52
+
#!/usr/bin/env -S scala-cli shebang -S 3
53
+
54
+
println(args.size)
55
+
println(args.headOption)
56
+
```
57
+
```bash
58
+
chmod +x hello
59
+
./hello Hello World
60
+
#2
61
+
#Some(Hello)
62
+
```
63
+
Note that files with no extension are always run as scripts even though they may contain e.g. a valid `.scala` program.
64
+
65
+
Also, do note that this feature has only been added for `shebang` - the `run` sub-command (which is the default way of running inputs when a sub-command is not specified explicitly) will not support this.
66
+
67
+
Added by [@MaciejG604](https://github.com/MaciejG604) in [#1802](https://github.com/VirtusLab/scala-cli/pull/1802)
68
+
69
+
### Export Project configuration to Json
70
+
71
+
It is now possible to export configuration from Scala CLI project to Json format with the `export` sub-command.
72
+
73
+
```bash ignore
74
+
scala-cli --power export --json .
75
+
```
76
+
77
+
It is currently exporting basic information about the project and includes, for example, the following fields:
78
+
79
+
- ScalaVersion
80
+
- Platform
81
+
- Sources
82
+
- Dependencies
83
+
- Resolvers
84
+
85
+
86
+
Example of generated Json output:
87
+
```json
88
+
{
89
+
"scalaVersion": "3.2.2",
90
+
"platform": "JVM",
91
+
"scopes": {
92
+
"main": {
93
+
"sources": [
94
+
"Hello.scala"
95
+
],
96
+
"dependencies": [
97
+
{
98
+
"groupId": "com.lihaoyi",
99
+
"artifactId": {
100
+
"name": "pprint",
101
+
"fullName": "pprint_3"
102
+
},
103
+
"version": "0.6.6"
104
+
}
105
+
],
106
+
...
107
+
}
108
+
}
109
+
}
110
+
```
111
+
112
+
Added by [@MaciejG604](https://github.com/MaciejG604) in [#1840](https://github.com/VirtusLab/scala-cli/pull/1840)
113
+
114
+
### Rename `using lib` to `using dep`
115
+
116
+
To be more consistent with dependency command line options `--dep`, the dependency using directive is now passed by `using dep`.
117
+
Please note that we have kept the alias of the old directive (`lib`, `libs`) for backwards compatibility.
118
+
119
+
```scala compile
120
+
//>usingdep"org.scalameta::munit:0.7.29"
121
+
```
122
+
Renamed by [@lwronski](https://github.com/lwronski) in [#1827](https://github.com/VirtusLab/scala-cli/pull/1827)
123
+
124
+
### Other breaking changes
125
+
126
+
#### Remove ammonite imports support
127
+
The support for `$ivy` and `$dep` ammonite imports has been removed.
128
+
To easily convert existing `$ivy` and `$dep` imports into the `using dep` directive in your sources, you can use the provided actionable diagnostic.
Removed by [@MaciejG604](https://github.com/MaciejG604) in [#1787](https://github.com/VirtusLab/scala-cli/pull/1787)
133
+
134
+
#### Drop the `metabrowse` sub-command
135
+
136
+
With this release, support for Metabrowse has been removed from Scala CLI. This change was made in order to limit the number of features that we need to support, especially since the `Metabrowse` project is no longer being actively worked on.
137
+
138
+
Remove by [@lwronski](https://github.com/lwronski) in [#1867](https://github.com/VirtusLab/scala-cli/pull/1867)
139
+
140
+
### Other changes
141
+
142
+
* Add cross-platform toolkit dependency by [@bishabosha](https://github.com/bishabosha) in [#1810](https://github.com/VirtusLab/scala-cli/pull/1810)
143
+
* Show explain message when is enabled by [@lwronski](https://github.com/lwronski) in [#1830](https://github.com/VirtusLab/scala-cli/pull/1830)
144
+
* Read home directory from env variable instead of option from command line by [@lwronski](https://github.com/lwronski) in [#1842](https://github.com/VirtusLab/scala-cli/pull/1842)
145
+
* Add build/taskStart and taskFinish to the exception reporting BSP mechanism by [@MaciejG604](https://github.com/MaciejG604) in [#1821](https://github.com/VirtusLab/scala-cli/pull/1821)
146
+
* blooprifle: report exit code in exception by [@Flowdalic](https://github.com/flowdalic) in [#1844](https://github.com/VirtusLab/scala-cli/pull/1844)
147
+
* Suppress lib update warning by [@MaciejG604](https://github.com/MaciejG604) in [#1848](https://github.com/VirtusLab/scala-cli/pull/1848)
148
+
* Invalid subcommand arg by [@MaciejG604](https://github.com/MaciejG604) in [#1811](https://github.com/VirtusLab/scala-cli/pull/1811)
149
+
150
+
151
+
#### SIP-related changes
152
+
* Add a warning for the `-run` option of the legacy `scala` runner, instead of failing by [@Gedochao](https://github.com/Gedochao) in [#1801](https://github.com/VirtusLab/scala-cli/pull/1801)
153
+
* Add warnings for the deprecated `-Yscriptrunner` legacy `scala` runner option instead of passing it to `scalac` by [@Gedochao](https://github.com/Gedochao) in [#1804](https://github.com/VirtusLab/scala-cli/pull/1804)
154
+
* Filter out `restricted` & `experimental` options from `SIP` mode help by [@Gedochao](https://github.com/Gedochao) in [#1812](https://github.com/VirtusLab/scala-cli/pull/1812)
155
+
* Warn in sip mode when using restricted command by [@lwronski](https://github.com/lwronski) in [#1862](https://github.com/VirtusLab/scala-cli/pull/1862)
156
+
* Add more detail for sub-commands' help messages by [@Gedochao](https://github.com/Gedochao) in [#1852](https://github.com/VirtusLab/scala-cli/pull/1852)
157
+
* Fix printing not supported option in restricted mode by [@lwronski](https://github.com/lwronski) in [#1861](https://github.com/VirtusLab/scala-cli/pull/1861)
158
+
* Shorter options help by [@Gedochao](https://github.com/Gedochao) in [#1872](https://github.com/VirtusLab/scala-cli/pull/1872)
159
+
160
+
#### Fixes
161
+
162
+
* Fix warning about using directives in multiple files when two java files are present by [@MaciejG604](https://github.com/MaciejG604) in [#1796](https://github.com/VirtusLab/scala-cli/pull/1796)
163
+
* Quit flag not suppresses compilation errors by [@lwronski](https://github.com/lwronski) in [#1792](https://github.com/VirtusLab/scala-cli/pull/1792)
164
+
* Dont warn about target directives by [@MaciejG604](https://github.com/MaciejG604) in [#1803](https://github.com/VirtusLab/scala-cli/pull/1803)
165
+
* Fix - actionable actions not suggest update to previous version by [@lwronski](https://github.com/lwronski) in [#1813](https://github.com/VirtusLab/scala-cli/pull/1813)
166
+
* Fix actionable action when uses latest sytanx version in lib by [@lwronski](https://github.com/lwronski) in [#1817](https://github.com/VirtusLab/scala-cli/pull/1817)
167
+
* Prevent NPE from being thrown by the `export` sub-command if `testFramework` isn't defined by [@Gedochao](https://github.com/Gedochao) in [#1814](https://github.com/VirtusLab/scala-cli/pull/1814)
168
+
* Fix message checking in test by [@MaciejG604](https://github.com/MaciejG604) in [#1847](https://github.com/VirtusLab/scala-cli/pull/1847)
169
+
* blooprifle: add -XX:+IgnoreUnrecognizedVMOptions to hardCodedDefaultJavaOpts by [@Flowdalic](https://github.com/flowdalic) in [#1845](https://github.com/VirtusLab/scala-cli/pull/1845)
170
+
* Trim passwords obtained as command result by [@MaciejG604](https://github.com/MaciejG604) in [#1871](https://github.com/VirtusLab/scala-cli/pull/1871)
171
+
172
+
#### Build and internal changes
173
+
* Ignore Bloop server early exit if it signals an already running server by [@alexarchambault](https://github.com/alexarchambault) in [#1799](https://github.com/VirtusLab/scala-cli/pull/1799)
174
+
* Build aarch64 linux launcher using m1 by [@lwronski](https://github.com/lwronski) in [#1805](https://github.com/VirtusLab/scala-cli/pull/1805)
175
+
* Remove latest supported scala version mechanism by [@lwronski](https://github.com/lwronski) in [#1816](https://github.com/VirtusLab/scala-cli/pull/1816)
176
+
* Switch `scala-cli-signing` to `org.virtuslab` and bump to `0.1.15` by [@Gedochao](https://github.com/Gedochao) in [#1853](https://github.com/VirtusLab/scala-cli/pull/1853)
177
+
* Add clang to scala-cli docker image by [@lwronski](https://github.com/lwronski) in [#1846](https://github.com/VirtusLab/scala-cli/pull/1846)
178
+
* bloop-file: show timeout value in error message by [@Flowdalic](https://github.com/flowdalic) in [#1855](https://github.com/VirtusLab/scala-cli/pull/1855)
179
+
* Back port of documentation changes to main by [@github-actions](https://github.com/github-actions) in [#1860](https://github.com/VirtusLab/scala-cli/pull/1860)
180
+
* Run generate reference doc as non sip by [@lwronski](https://github.com/lwronski) in [#1866](https://github.com/VirtusLab/scala-cli/pull/1866)
181
+
* Bump `case-app` to `2.1.0-M23` by [@lwronski](https://github.com/lwronski) in [#1868](https://github.com/VirtusLab/scala-cli/pull/1868)
182
+
183
+
#### Documentation updates
184
+
* Update docker example command by [@MaciejG604](https://github.com/MaciejG604) in [#1798](https://github.com/VirtusLab/scala-cli/pull/1798)
185
+
* Tweak `--watch`/`--restart` disambiguation in the help messages & docs by [@Gedochao](https://github.com/Gedochao) in [#1819](https://github.com/VirtusLab/scala-cli/pull/1819)
186
+
* Release notes - msi malware analysis by [@lwronski](https://github.com/lwronski) in [#1832](https://github.com/VirtusLab/scala-cli/pull/1832)
187
+
* Improve 'shebang' help message wrt program *arguments* by [@Flowdalic](https://github.com/flowdalic) in [#1829](https://github.com/VirtusLab/scala-cli/pull/1829)
188
+
* docs: Fix Yum manual installation step by [@tgodzik](https://github.com/tgodzik) in [#1850](https://github.com/VirtusLab/scala-cli/pull/1850)
189
+
190
+
#### Updates & maintenance
191
+
* Update scala-cli.sh launcher for 0.1.20 by [@github-actions](https://github.com/github-actions) in [#1790](https://github.com/VirtusLab/scala-cli/pull/1790)
192
+
* Bump VirtusLab/scala-cli-setup from 0.1.19 to 0.1.20 by [@dependabot](https://github.com/dependabot) in [#1806](https://github.com/VirtusLab/scala-cli/pull/1806)
193
+
194
+
## New Contributors
195
+
*[@Flowdalic](https://github.com/flowdalic) made their first contribution in [#1829](https://github.com/VirtusLab/scala-cli/pull/1829)
0 commit comments