From 18f501ba4b5d68e1c132132526d486dcb39a370c Mon Sep 17 00:00:00 2001 From: gh-actions Date: Tue, 19 Sep 2023 09:03:15 +0000 Subject: [PATCH] Deploy website - based on 8402cc96bb63456c8db52452c2bfda201857f3c3 --- 404.html | 4 ++-- assets/js/f5e5b6d4.5f697445.js | 1 + assets/js/f5e5b6d4.7ae32b37.js | 1 - .../{runtime~main.1f17a61c.js => runtime~main.cbb9935d.js} | 2 +- docs/commands/basics/index.html | 4 ++-- docs/commands/clean/index.html | 4 ++-- docs/commands/compile/index.html | 4 ++-- docs/commands/completions/index.html | 4 ++-- docs/commands/config/index.html | 4 ++-- docs/commands/doc/index.html | 4 ++-- docs/commands/export/index.html | 4 ++-- docs/commands/fmt/index.html | 4 ++-- docs/commands/misc/default-file/index.html | 4 ++-- docs/commands/misc/pgp/index.html | 4 ++-- docs/commands/package/index.html | 4 ++-- docs/commands/publishing/publish-local/index.html | 4 ++-- docs/commands/publishing/publish-setup/index.html | 4 ++-- docs/commands/publishing/publish/index.html | 4 ++-- docs/commands/repl/index.html | 7 ++++--- docs/commands/run/index.html | 4 ++-- docs/commands/setup-ide/index.html | 4 ++-- docs/commands/shebang/index.html | 4 ++-- docs/commands/test/index.html | 4 ++-- docs/commands/version/index.html | 4 ++-- docs/cookbooks/debugging/index.html | 4 ++-- docs/cookbooks/gh-action/index.html | 4 ++-- docs/cookbooks/gists/index.html | 4 ++-- docs/cookbooks/instant-startup-scala-scripts/index.html | 4 ++-- docs/cookbooks/intellij-multi-bsp/index.html | 4 ++-- docs/cookbooks/intellij-sbt-with-bsp/index.html | 4 ++-- docs/cookbooks/intellij/index.html | 4 ++-- docs/cookbooks/intro/index.html | 4 ++-- docs/cookbooks/native-images/index.html | 4 ++-- docs/cookbooks/scala-docker/index.html | 4 ++-- docs/cookbooks/scala-jvm/index.html | 4 ++-- docs/cookbooks/scala-package/index.html | 4 ++-- docs/cookbooks/scala-scripts/index.html | 4 ++-- docs/cookbooks/scala-versions/index.html | 4 ++-- docs/cookbooks/test-only/index.html | 4 ++-- docs/cookbooks/vscode/index.html | 4 ++-- docs/getting_started/index.html | 4 ++-- docs/guides/configuration/index.html | 4 ++-- docs/guides/dependencies/index.html | 4 ++-- docs/guides/ide/index.html | 4 ++-- docs/guides/internals/index.html | 4 ++-- docs/guides/intro/index.html | 4 ++-- docs/guides/markdown/index.html | 4 ++-- docs/guides/old-runner-migration/index.html | 4 ++-- docs/guides/piping/index.html | 4 ++-- docs/guides/proxies/index.html | 4 ++-- docs/guides/sbt-mill/index.html | 4 ++-- docs/guides/scala-js/index.html | 4 ++-- docs/guides/scala-native/index.html | 4 ++-- docs/guides/scripts/index.html | 4 ++-- docs/guides/shebang/index.html | 4 ++-- docs/guides/snippets/index.html | 4 ++-- docs/guides/toolkit/index.html | 4 ++-- docs/guides/update-dependencies/index.html | 4 ++-- docs/guides/using-directives/index.html | 4 ++-- docs/guides/verbosity/index.html | 4 ++-- docs/overview/index.html | 4 ++-- docs/reference/bloop/index.html | 4 ++-- docs/reference/build-info/index.html | 4 ++-- docs/reference/cli-options/index.html | 4 ++-- docs/reference/commands/index.html | 4 ++-- docs/reference/dependency/index.html | 4 ++-- docs/reference/directives/index.html | 4 ++-- docs/reference/password-options/index.html | 4 ++-- docs/reference/proxy-authentication/index.html | 4 ++-- docs/reference/root-dir/index.html | 4 ++-- docs/reference/scala-command/cli-options/index.html | 4 ++-- docs/reference/scala-command/commands/index.html | 4 ++-- docs/reference/scala-command/directives/index.html | 4 ++-- docs/reference/scala-command/index.html | 4 ++-- .../scala-command/runner-specification/index.html | 4 ++-- docs/reference/scala-versions/index.html | 4 ++-- docs/release_notes/index.html | 4 ++-- docs/under-the-hood/index.html | 4 ++-- education/index.html | 4 ++-- index.html | 4 ++-- install/index.html | 4 ++-- markdown-page/index.html | 4 ++-- projects/index.html | 4 ++-- prototyping/index.html | 4 ++-- scripting/index.html | 4 ++-- search/index.html | 4 ++-- spark/index.html | 4 ++-- 87 files changed, 172 insertions(+), 171 deletions(-) create mode 100644 assets/js/f5e5b6d4.5f697445.js delete mode 100644 assets/js/f5e5b6d4.7ae32b37.js rename assets/js/{runtime~main.1f17a61c.js => runtime~main.cbb9935d.js} (79%) diff --git a/404.html b/404.html index cb0b4f96cc..79fb7cbbe7 100644 --- a/404.html +++ b/404.html @@ -4,13 +4,13 @@ Page Not Found | Scala CLI - +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/assets/js/f5e5b6d4.5f697445.js b/assets/js/f5e5b6d4.5f697445.js new file mode 100644 index 0000000000..4549a95bf3 --- /dev/null +++ b/assets/js/f5e5b6d4.5f697445.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4262],{9705:function(e,a,t){t.d(a,{m:function(){return i},v:function(){return r}});var n=t(7294),s=t(2004);function r(e){var a=e.children;return n.createElement("div",{className:"runnable-command"},a)}function i(e){var a=e.url;return n.createElement(s.Z,{playing:!0,loop:!0,muted:!0,controls:!0,width:"100%",height:"",url:a})}},3674:function(e,a,t){t.r(a),t.d(a,{assets:function(){return m},contentTitle:function(){return c},default:function(){return h},frontMatter:function(){return o},metadata:function(){return p},toc:function(){return d}});var n=t(3117),s=t(102),r=(t(7294),t(3905)),i=t(9705),l=["components"],o={title:"REPL",sidebar_position:8},c=void 0,p={unversionedId:"commands/repl",id:"commands/repl",title:"REPL",description:"The repl command starts a Scala REPL, which lets you interactively run your code and inspect its results:",source:"@site/docs/commands/repl.md",sourceDirName:"commands",slug:"/commands/repl",permalink:"/docs/commands/repl",draft:!1,editUrl:"https://github.com/Virtuslab/scala-cli/edit/main/website/docs/commands/repl.md",tags:[],version:"current",sidebarPosition:8,frontMatter:{title:"REPL",sidebar_position:8},sidebar:"tutorialSidebar",previous:{title:"Test",permalink:"/docs/commands/test"},next:{title:"IDE Setup",permalink:"/docs/commands/setup-ide"}},m={},d=[{value:"Inject code as JAR file in class path",id:"inject-code-as-jar-file-in-class-path",level:2}],u={toc:d};function h(e){var a=e.components,t=(0,s.Z)(e,l);return(0,r.kt)("wrapper",(0,n.Z)({},u,t,{components:a,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"repl")," command starts a Scala REPL, which lets you interactively run your code and inspect its results:"),(0,r.kt)(i.v,{mdxType:"ChainedSnippets"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"ignore",ignore:!0},"scala-cli repl\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"},'scala> println("Hello Scala")\nHello Scala\n\nscala> :exit\n'))),(0,r.kt)("p",null,"Scala CLI by default uses the normal Scala REPL."),(0,r.kt)("p",null,"If you prefer to use the ",(0,r.kt)("a",{parentName:"p",href:"https://ammonite.io/#Ammonite-REPL"},"Ammonite REPL"),", specify ",(0,r.kt)("inlineCode",{parentName:"p"},"--amm")," to launch it rather than the default REPL:"),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Using the Ammonite REPL is restricted and requires setting the ",(0,r.kt)("inlineCode",{parentName:"p"},"--power")," option to be used.\nYou can pass it explicitly or set it globally by running:"),(0,r.kt)("pre",{parentName:"admonition"},(0,r.kt)("code",{parentName:"pre"},"scala-cli config power true\n"))),(0,r.kt)(i.v,{mdxType:"ChainedSnippets"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"ignore",ignore:!0},"scala-cli --power repl --amm\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"},'Loading...\nWelcome to the Ammonite Repl 2.4.0-23-76673f7f (Scala 3.0.2 Java 11.0.11)\n@ println("Hello ammonite")\nHello ammonite\n@ exit\nBye!\n'))),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"repl")," command accepts the same arguments as the ",(0,r.kt)("a",{parentName:"p",href:"/docs/commands/compile"},"compile")," command. It first compiles any provided sources, and then exposes those results and any provided dependencies to the REPL session:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-scala",metastring:"title=mylibrary/Messages.scala",title:"mylibrary/Messages.scala"},'package mylibrary\n\nobject Messages {\n def message = "Hello"\n def print(): Unit = println(message)\n}\n')),(0,r.kt)(i.v,{mdxType:"ChainedSnippets"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"ignore",ignore:!0},"scala-cli repl mylibrary/Messages.scala\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"},"Compiling project (Scala 3.0.2, JVM)\nCompiled project (Scala 3.0.2, JVM)\nscala> import mylibrary._\n\nscala> Messages.print()\nHello\n\nscala> :quit\n"))),(0,r.kt)("h2",{id:"inject-code-as-jar-file-in-class-path"},"Inject code as JAR file in class path"),(0,r.kt)("p",null,"If your application inspects its class path, and requires only JAR files in it, use ",(0,r.kt)("inlineCode",{parentName:"p"},"--as-jar")," to\nput the Scala CLI project in the class path as a JAR file rather than as a directory:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"ignore",ignore:!0},"scala-cli repl Foo.scala --as-jar\n")))}h.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/f5e5b6d4.7ae32b37.js b/assets/js/f5e5b6d4.7ae32b37.js deleted file mode 100644 index 51a1cb61af..0000000000 --- a/assets/js/f5e5b6d4.7ae32b37.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4262],{9705:function(e,a,t){t.d(a,{m:function(){return r},v:function(){return l}});var n=t(7294),s=t(2004);function l(e){var a=e.children;return n.createElement("div",{className:"runnable-command"},a)}function r(e){var a=e.url;return n.createElement(s.Z,{playing:!0,loop:!0,muted:!0,controls:!0,width:"100%",height:"",url:a})}},3674:function(e,a,t){t.r(a),t.d(a,{assets:function(){return m},contentTitle:function(){return c},default:function(){return h},frontMatter:function(){return o},metadata:function(){return p},toc:function(){return d}});var n=t(3117),s=t(102),l=(t(7294),t(3905)),r=t(9705),i=["components"],o={title:"REPL",sidebar_position:8},c=void 0,p={unversionedId:"commands/repl",id:"commands/repl",title:"REPL",description:"The repl command starts a Scala REPL, which lets you interactively run your code and inspect its results:",source:"@site/docs/commands/repl.md",sourceDirName:"commands",slug:"/commands/repl",permalink:"/docs/commands/repl",draft:!1,editUrl:"https://github.com/Virtuslab/scala-cli/edit/main/website/docs/commands/repl.md",tags:[],version:"current",sidebarPosition:8,frontMatter:{title:"REPL",sidebar_position:8},sidebar:"tutorialSidebar",previous:{title:"Test",permalink:"/docs/commands/test"},next:{title:"IDE Setup",permalink:"/docs/commands/setup-ide"}},m={},d=[{value:"Inject code as JAR file in class path",id:"inject-code-as-jar-file-in-class-path",level:2}],u={toc:d};function h(e){var a=e.components,t=(0,s.Z)(e,i);return(0,l.kt)("wrapper",(0,n.Z)({},u,t,{components:a,mdxType:"MDXLayout"}),(0,l.kt)("p",null,"The ",(0,l.kt)("inlineCode",{parentName:"p"},"repl")," command starts a Scala REPL, which lets you interactively run your code and inspect its results:"),(0,l.kt)(r.v,{mdxType:"ChainedSnippets"},(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-bash",metastring:"ignore",ignore:!0},"scala-cli repl\n")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-text"},'scala> println("Hello Scala")\nHello Scala\n\nscala> :exit\n'))),(0,l.kt)("p",null,"Scala CLI by default uses the normal Scala REPL."),(0,l.kt)("p",null,"If you prefer to use the ",(0,l.kt)("a",{parentName:"p",href:"https://ammonite.io/#Ammonite-REPL"},"Ammonite REPL"),", specify ",(0,l.kt)("inlineCode",{parentName:"p"},"--amm")," to launch it rather than the default REPL:"),(0,l.kt)(r.v,{mdxType:"ChainedSnippets"},(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-bash",metastring:"ignore",ignore:!0},"scala-cli repl --amm\n")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-text"},'Loading...\nWelcome to the Ammonite Repl 2.4.0-23-76673f7f (Scala 3.0.2 Java 11.0.11)\n@ println("Hello ammonite")\nHello ammonite\n@ exit\nBye!\n'))),(0,l.kt)("p",null,"The ",(0,l.kt)("inlineCode",{parentName:"p"},"repl")," command accepts the same arguments as the ",(0,l.kt)("a",{parentName:"p",href:"/docs/commands/compile"},"compile")," command. It first compiles any provided sources, and then exposes those results and any provided dependencies to the REPL session:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-scala",metastring:"title=mylibrary/Messages.scala",title:"mylibrary/Messages.scala"},'package mylibrary\n\nobject Messages {\n def message = "Hello"\n def print(): Unit = println(message)\n}\n')),(0,l.kt)(r.v,{mdxType:"ChainedSnippets"},(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-bash",metastring:"ignore",ignore:!0},"scala-cli repl mylibrary/Messages.scala\n")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-text"},"Compiling project (Scala 3.0.2, JVM)\nCompiled project (Scala 3.0.2, JVM)\nscala> import mylibrary._\n\nscala> Messages.print()\nHello\n\nscala> :quit\n"))),(0,l.kt)("h2",{id:"inject-code-as-jar-file-in-class-path"},"Inject code as JAR file in class path"),(0,l.kt)("p",null,"If your application inspects its class path, and requires only JAR files in it, use ",(0,l.kt)("inlineCode",{parentName:"p"},"--as-jar")," to\nput the Scala CLI project in the class path as a JAR file rather than as a directory:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-bash",metastring:"ignore",ignore:!0},"scala-cli repl Foo.scala --as-jar\n")))}h.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.1f17a61c.js b/assets/js/runtime~main.cbb9935d.js similarity index 79% rename from assets/js/runtime~main.1f17a61c.js rename to assets/js/runtime~main.cbb9935d.js index 4f46eb3684..995b44a6d8 100644 --- a/assets/js/runtime~main.1f17a61c.js +++ b/assets/js/runtime~main.cbb9935d.js @@ -1 +1 @@ -!function(){"use strict";var e,f,a,c,t,b={},n={};function r(e){var f=n[e];if(void 0!==f)return f.exports;var a=n[e]={exports:{}};return b[e].call(a.exports,a,a.exports,r),a.exports}r.m=b,e=[],r.O=function(f,a,c,t){if(!a){var b=1/0;for(u=0;u=t)&&Object.keys(r.O).every((function(e){return r.O[e](a[d])}))?a.splice(d--,1):(n=!1,t0&&e[u-1][2]>t;u--)e[u]=e[u-1];e[u]=[a,c,t]},r.n=function(e){var f=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(f,{a:f}),f},a=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},r.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var t=Object.create(null);r.r(t);var b={};f=f||[null,a({}),a([]),a(a)];for(var n=2&c&&e;"object"==typeof n&&!~f.indexOf(n);n=a(n))Object.getOwnPropertyNames(n).forEach((function(f){b[f]=function(){return e[f]}}));return b.default=function(){return e},r.d(t,b),t},r.d=function(e,f){for(var a in f)r.o(f,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:f[a]})},r.f={},r.e=function(e){return Promise.all(Object.keys(r.f).reduce((function(f,a){return r.f[a](e,f),f}),[]))},r.u=function(e){return"assets/js/"+({36:"a1c89c5c",53:"935f2afb",135:"e6a70738",201:"a0ec8f61",285:"47132975",415:"7898142e",557:"c601bb92",980:"4f000067",981:"dae2f737",993:"b09f0486",1103:"dab365ce",1318:"24c84faf",1372:"1db64337",1476:"5efa792e",1596:"88904182",1611:"822c7e90",1614:"7cbbe09b",1786:"44e56df9",1815:"747d4895",1976:"542b4994",2114:"887b28d2",2128:"18bccaf0",2217:"d2579eb1",2293:"550e4c4f",2301:"2245b6ac",2516:"3b7245f6",2585:"b9a43f53",3085:"1f391b9e",3232:"05390651",3289:"2ef1a504",3303:"d37d8529",3355:"193cf812",3633:"bec8f632",3782:"1af3b333",3813:"4a611cfe",3831:"2dbe2c13",3989:"6ff4819b",4195:"c4f5d8e4",4240:"d2eb686c",4262:"f5e5b6d4",4264:"0086a645",4341:"31dabe8e",4474:"c8f771b7",4602:"93f256be",4631:"043a06fe",4753:"b2f85989",4982:"a1a07729",5627:"8c4eb8fa",5631:"4cf54a75",5672:"878f699c",5698:"90c7d31f",5769:"ee7ef1d2",5871:"38a65b4a",5890:"680365f8",6021:"0947fe69",6225:"b124165e",6347:"92bb876c",6391:"d4eb1be7",6393:"11e5aa22",6607:"2c3e8a0d",6705:"ededae5d",6970:"80d63ffc",7024:"94d72148",7275:"d13295ad",7414:"393be207",7448:"7cb7f952",7898:"a977e4a7",7915:"71e81e35",7918:"17896441",7920:"1a4e3797",8003:"98f6c6be",8119:"b863b110",8134:"11ff2956",8276:"5f07a975",8368:"a6a0cecd",8421:"607666c7",8618:"9a2cec18",8658:"16d4c99a",8702:"b31813b0",9114:"7c216827",9119:"99f5abe6",9149:"b75b8a81",9277:"e9e3ad82",9306:"f5e1ed95",9379:"852a0352",9497:"7f814673",9514:"1be78505",9557:"956ba2e7",9945:"962a7b5d",9962:"4a26cc46"}[e]||e)+"."+{36:"ffdedc1d",53:"2d4e94b7",135:"a7b41adc",201:"2b41b054",272:"016a7628",285:"bcfb12f7",415:"1161927a",557:"42a23062",980:"b31e46cb",981:"7b8cf93b",993:"8b946939",1068:"2806c0b8",1103:"654bbff5",1318:"94664d12",1372:"74777383",1476:"447b6374",1596:"a81211c1",1611:"d2d40e1b",1614:"76688c14",1786:"471bb788",1815:"20b8b09f",1976:"1ca85534",2114:"0a7f302c",2128:"f83b6625",2217:"e82a5270",2293:"0726781c",2301:"60db97ce",2516:"027c1b67",2585:"b6f2cedf",3085:"932a3158",3232:"5b55f52a",3289:"e644ff10",3303:"d4f4934b",3355:"fa7a32a0",3633:"8219179f",3782:"e3d1410b",3813:"8984c714",3831:"3115b71a",3989:"2400b0c1",4195:"53d2d59f",4240:"b5c2f8ab",4262:"7ae32b37",4264:"050f9bdf",4341:"8a3ca881",4474:"0f5a2cc8",4602:"551ea40a",4631:"2738243f",4753:"85157018",4972:"c6e5c8d8",4982:"c958deaa",5627:"bdafa306",5631:"45338991",5672:"837f0f6b",5698:"a1a1aca1",5769:"14320517",5871:"c520dee5",5890:"f0f4cba1",6021:"e22fb04f",6225:"dc966ca1",6347:"290c5be8",6391:"73885548",6393:"ee7f7c1e",6607:"04d3481c",6705:"463c50ca",6780:"1f50355d",6945:"87ff0226",6970:"ac0499b2",7024:"37c024e9",7275:"9a29495b",7414:"67887543",7448:"aa4b399e",7898:"912e32ab",7915:"ecbb1ac9",7918:"504ec875",7920:"b52b7b91",8003:"10f71554",8119:"2ba6a5db",8134:"4e48e303",8276:"c2e2e574",8368:"6eaea277",8421:"53863fdf",8618:"8ac9d5f6",8658:"c0dc0c1e",8702:"25e9f176",8894:"ef41ad74",9114:"e680730d",9119:"f100ab1a",9149:"af64d324",9277:"1e6cb569",9306:"01cc0d68",9379:"7200e276",9497:"1bf677b1",9514:"29038907",9557:"a456ab93",9945:"0b72890d",9962:"3a8e8f56"}[e]+".js"},r.miniCssF=function(e){},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,f){return Object.prototype.hasOwnProperty.call(e,f)},c={},t="website:",r.l=function(e,f,a,b){if(c[e])c[e].push(f);else{var n,d;if(void 0!==a)for(var o=document.getElementsByTagName("script"),u=0;u=b)&&Object.keys(r.O).every((function(e){return r.O[e](a[d])}))?a.splice(d--,1):(n=!1,b0&&e[u-1][2]>b;u--)e[u]=e[u-1];e[u]=[a,c,b]},r.n=function(e){var f=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(f,{a:f}),f},a=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},r.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var b=Object.create(null);r.r(b);var t={};f=f||[null,a({}),a([]),a(a)];for(var n=2&c&&e;"object"==typeof n&&!~f.indexOf(n);n=a(n))Object.getOwnPropertyNames(n).forEach((function(f){t[f]=function(){return e[f]}}));return t.default=function(){return e},r.d(b,t),b},r.d=function(e,f){for(var a in f)r.o(f,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:f[a]})},r.f={},r.e=function(e){return Promise.all(Object.keys(r.f).reduce((function(f,a){return r.f[a](e,f),f}),[]))},r.u=function(e){return"assets/js/"+({36:"a1c89c5c",53:"935f2afb",135:"e6a70738",201:"a0ec8f61",285:"47132975",415:"7898142e",557:"c601bb92",980:"4f000067",981:"dae2f737",993:"b09f0486",1103:"dab365ce",1318:"24c84faf",1372:"1db64337",1476:"5efa792e",1596:"88904182",1611:"822c7e90",1614:"7cbbe09b",1786:"44e56df9",1815:"747d4895",1976:"542b4994",2114:"887b28d2",2128:"18bccaf0",2217:"d2579eb1",2293:"550e4c4f",2301:"2245b6ac",2516:"3b7245f6",2585:"b9a43f53",3085:"1f391b9e",3232:"05390651",3289:"2ef1a504",3303:"d37d8529",3355:"193cf812",3633:"bec8f632",3782:"1af3b333",3813:"4a611cfe",3831:"2dbe2c13",3989:"6ff4819b",4195:"c4f5d8e4",4240:"d2eb686c",4262:"f5e5b6d4",4264:"0086a645",4341:"31dabe8e",4474:"c8f771b7",4602:"93f256be",4631:"043a06fe",4753:"b2f85989",4982:"a1a07729",5627:"8c4eb8fa",5631:"4cf54a75",5672:"878f699c",5698:"90c7d31f",5769:"ee7ef1d2",5871:"38a65b4a",5890:"680365f8",6021:"0947fe69",6225:"b124165e",6347:"92bb876c",6391:"d4eb1be7",6393:"11e5aa22",6607:"2c3e8a0d",6705:"ededae5d",6970:"80d63ffc",7024:"94d72148",7275:"d13295ad",7414:"393be207",7448:"7cb7f952",7898:"a977e4a7",7915:"71e81e35",7918:"17896441",7920:"1a4e3797",8003:"98f6c6be",8119:"b863b110",8134:"11ff2956",8276:"5f07a975",8368:"a6a0cecd",8421:"607666c7",8618:"9a2cec18",8658:"16d4c99a",8702:"b31813b0",9114:"7c216827",9119:"99f5abe6",9149:"b75b8a81",9277:"e9e3ad82",9306:"f5e1ed95",9379:"852a0352",9497:"7f814673",9514:"1be78505",9557:"956ba2e7",9945:"962a7b5d",9962:"4a26cc46"}[e]||e)+"."+{36:"ffdedc1d",53:"2d4e94b7",135:"a7b41adc",201:"2b41b054",272:"016a7628",285:"bcfb12f7",415:"1161927a",557:"42a23062",980:"b31e46cb",981:"7b8cf93b",993:"8b946939",1068:"2806c0b8",1103:"654bbff5",1318:"94664d12",1372:"74777383",1476:"447b6374",1596:"a81211c1",1611:"d2d40e1b",1614:"76688c14",1786:"471bb788",1815:"20b8b09f",1976:"1ca85534",2114:"0a7f302c",2128:"f83b6625",2217:"e82a5270",2293:"0726781c",2301:"60db97ce",2516:"027c1b67",2585:"b6f2cedf",3085:"932a3158",3232:"5b55f52a",3289:"e644ff10",3303:"d4f4934b",3355:"fa7a32a0",3633:"8219179f",3782:"e3d1410b",3813:"8984c714",3831:"3115b71a",3989:"2400b0c1",4195:"53d2d59f",4240:"b5c2f8ab",4262:"5f697445",4264:"050f9bdf",4341:"8a3ca881",4474:"0f5a2cc8",4602:"551ea40a",4631:"2738243f",4753:"85157018",4972:"c6e5c8d8",4982:"c958deaa",5627:"bdafa306",5631:"45338991",5672:"837f0f6b",5698:"a1a1aca1",5769:"14320517",5871:"c520dee5",5890:"f0f4cba1",6021:"e22fb04f",6225:"dc966ca1",6347:"290c5be8",6391:"73885548",6393:"ee7f7c1e",6607:"04d3481c",6705:"463c50ca",6780:"1f50355d",6945:"87ff0226",6970:"ac0499b2",7024:"37c024e9",7275:"9a29495b",7414:"67887543",7448:"aa4b399e",7898:"912e32ab",7915:"ecbb1ac9",7918:"504ec875",7920:"b52b7b91",8003:"10f71554",8119:"2ba6a5db",8134:"4e48e303",8276:"c2e2e574",8368:"6eaea277",8421:"53863fdf",8618:"8ac9d5f6",8658:"c0dc0c1e",8702:"25e9f176",8894:"ef41ad74",9114:"e680730d",9119:"f100ab1a",9149:"af64d324",9277:"1e6cb569",9306:"01cc0d68",9379:"7200e276",9497:"1bf677b1",9514:"29038907",9557:"a456ab93",9945:"0b72890d",9962:"3a8e8f56"}[e]+".js"},r.miniCssF=function(e){},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,f){return Object.prototype.hasOwnProperty.call(e,f)},c={},b="website:",r.l=function(e,f,a,t){if(c[e])c[e].push(f);else{var n,d;if(void 0!==a)for(var o=document.getElementsByTagName("script"),u=0;u Basics | Scala CLI - + @@ -27,7 +27,7 @@ about the start of compilation, and so on.

Warning suppression

Some particular warning logs can be suppressed, either for a particular command by passing an option or with a global config. More details can be found in the verbosity guide

- + \ No newline at end of file diff --git a/docs/commands/clean/index.html b/docs/commands/clean/index.html index 11246f5d94..713e26287d 100644 --- a/docs/commands/clean/index.html +++ b/docs/commands/clean/index.html @@ -4,13 +4,13 @@ Clean | Scala CLI - +

Clean

The clean command deletes all of the files generated by Scala CLI. This includes the .scala-build directory where Scala CLI writes outputs and stores its caches, and .bsp/scala-cli.json file which contains details for the BSP connection (necessary for importing a Scala CLI build to your IDE of choice).

- + \ No newline at end of file diff --git a/docs/commands/compile/index.html b/docs/commands/compile/index.html index 30a5c07ef9..4f418b9dbc 100644 --- a/docs/commands/compile/index.html +++ b/docs/commands/compile/index.html @@ -4,7 +4,7 @@ Compile | Scala CLI - + @@ -44,7 +44,7 @@ project.file file:

project.scala
//> using exclude "example/scala"

Compile-Only Dependencies

Compile-only dependencies, allow to include certain libraries exclusively at the time of the compilation. These dependencies are added to the class path during compilation, but won't be included when the application is run.

To declare a compile-only dependency, you should use the compileOnly.dep directive or --compile-lib command line option. For instance, to include the jsoniter-scala-macros library at compile-time, you would use:

CompileOnly.scala
//> using compileOnly.dep "com.github.plokhotnyuk.jsoniter-scala::jsoniter-scala-macros:2.23.2"

or by using the --compile-lib command line option:

scala-cli Hello.scala --compile-lib "com.github.plokhotnyuk.jsoniter-scala::jsoniter-scala-macros:2.23.2"
- + \ No newline at end of file diff --git a/docs/commands/completions/index.html b/docs/commands/completions/index.html index 44836988f2..eeb8521eec 100644 --- a/docs/commands/completions/index.html +++ b/docs/commands/completions/index.html @@ -4,13 +4,13 @@ Completions | Scala CLI - +

Completions

The completions commands can be used to install Scala CLI completions into your shell and uninstall them.

Installing completions

To install completions run the install-completions command:

scala-cli install-completions

Uninstalling completions

To uninstall completions run the uninstall-completions command:

scala-cli uninstall-completions
- + \ No newline at end of file diff --git a/docs/commands/config/index.html b/docs/commands/config/index.html index 94245f5ed2..692b01c106 100644 --- a/docs/commands/config/index.html +++ b/docs/commands/config/index.html @@ -4,7 +4,7 @@ Config | Scala CLI - + @@ -18,7 +18,7 @@ To randomly generate a pasword, use --pgp-password random instead. Also, the --email option or publish.user.email has to be specified for this subcommand to work properly.

Configuration values are stored in a directory under your home directory, with restricted permissions:

  • on macOS: ~/Library/Application Support/ScalaCli/secrets/config.json
  • on Linux: ~/.config/scala-cli/secrets/config.json
  • on Windows: %LOCALAPPDATA%\ScalaCli\secrets\config.json ( typically C:\Users\username\AppData\Local\ScalaCli\secrets\config.json)
- + \ No newline at end of file diff --git a/docs/commands/doc/index.html b/docs/commands/doc/index.html index 7fcfcad6ea..ab8d4b623f 100644 --- a/docs/commands/doc/index.html +++ b/docs/commands/doc/index.html @@ -4,7 +4,7 @@ Doc | Scala CLI - + @@ -12,7 +12,7 @@

Doc

Scala CLI can generate the API documentation of your Scala 2, Scala 3, and Java projects. It provides features similar to javadoc. The API documentation is generated in a directory whose files make up a static website:

Hello.scala
package hello
/** Hello object for running main method
*/
object Hello {
/**
* Main method
* @param args The command line arguments.
**/
def main(args: Array[String]): Unit =
println("Hello")
}
scala-cli doc Hello.scala -o scala-doc
# Wrote Scaladoc to ./scala-doc

The output directory scala-doc contains the static site files with your documentation.

After opening the generated static documentation (you have to open scala-doc/index.html in your browser), you will see the generated scaladoc documentation. The following screen shows the definition of the main method:

- + \ No newline at end of file diff --git a/docs/commands/export/index.html b/docs/commands/export/index.html index 0193aef169..9189d61c2b 100644 --- a/docs/commands/export/index.html +++ b/docs/commands/export/index.html @@ -4,7 +4,7 @@ Export ⚡️ | Scala CLI - + @@ -21,7 +21,7 @@ To change the build tool version used override the contents of dest_mill/.mill-version.

Exporting to JSON:

To export project information in a human-comprehensible format, use the --json flag. By default, exporting with the --json option prints to standard output, this can be changed with --output parameter by specifying a directory where to create the export.json file.

scala-cli --power export Hello.scala --json --output=dest_json

The result is the dest_json/export.json file:

dest_json/export.json
{
"scalaVersion": "3.1.3",
"platform": "JVM",
"scopes": {
"main": {
"sources": [
"Foo.scala"
],
"scalacOptions": [
"-Xasync"
],
"dependencies": [
{
"groupId": "com.lihaoyi",
"artifactId": {
"name": "os-lib",
"fullName": "os-lib_3"
},
"version": "0.9.0"
}
],
"resolvers": [
"https://repo1.maven.org/maven2",
"ivy:file:///Users/mgajek/Library/Caches/ScalaCli/local-repo/v0.1.20-111-648755-DIRTY2ba64fdc//[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]",
"ivy:file:/Users/mgajek/.ivy2/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]"
]
}
}
}
- + \ No newline at end of file diff --git a/docs/commands/fmt/index.html b/docs/commands/fmt/index.html index c7f22095cb..fed3d2474f 100644 --- a/docs/commands/fmt/index.html +++ b/docs/commands/fmt/index.html @@ -4,7 +4,7 @@ Format | Scala CLI - + @@ -16,7 +16,7 @@ would be ignored. In order to prevent that from happening, the --respect-project-filters option is set to true by default.

.scalafmt.conf
version = "3.5.8"
runner.dialect = scala3
project {
includePaths = [
"glob:**.scala",
"regex:.*\\.sc"
]
excludePaths = [
"glob:**/should/not/format/**.scala"
]
}
scala-cli fmt . --check
All files are formatted with scalafmt :)

You can explicitly set it to false if you want to disregard any filters configured in the project.excludePaths setting in your .scalafmt.conf for any reason.

scala-cli fmt . --check --respect-project-filters=false
--- a/.../should/not/format/ShouldNotFormat.scala
+++ b/.../should/not/format/ShouldNotFormat.scala
@@ -1,3 +1,3 @@
class ShouldNotFormat {
- println()
+ println()
}

How .scalafmt.conf file is generated

The Scala CLI fmt command runs scalafmt under the hood, which normally requires .scalafmt.conf configuration file with explicitly specified version and dialect fields. The way it is handled by Scala CLI is as follows:

At the beginning fmt looks for the configuration inside the file specified in the --scalafmt-conf option. If the option is not passed or the file doesn't exist, fmt looks for the existing configuration file inside current workspace directory. If the file is still not found, fmt looks for it inside git root directory. There are 3 possible cases:

  1. Configuration file with the specified version and dialect is found.
  2. Configuration file is found, but it doesn't have specified version or dialect.
  3. Configuration file is not found.
  • In the first case fmt uses the found .scalafmt.conf file to run scalafmt.
  • In the second case fmt creates a .scalafmt.conf file inside the .scala-build directory. Content of the previously found file is copied into the newly created file, missing parameters are inferred and written into the same file. Created file is used to run scalafmt.
  • In the third case fmt creates a .scalafmt.conf file inside the .scala-build directory, writes inferred version and dialect into it and uses it to run scalafmt.

If the --save-scalafmt-conf option is passed, then fmt command behaves as follows:

  • In the first case fmt uses the found .scalafmt.conf file to run scalafmt.
  • In the second case fmt infers missing parameters, writes them directly into the previously found file and then uses this file to run scalafmt.
  • In the third case fmt creates a .scalafmt.conf file in the current workspace directory, writes inferred version and dialect into it and uses it to run scalafmt.
note

If the configuration is passed in the --scalafmt-conf-str option, Scala CLI will behave exactly the same as if it found the specified configuration in a .scalafmt.conf file in the workspace.

- + \ No newline at end of file diff --git a/docs/commands/misc/default-file/index.html b/docs/commands/misc/default-file/index.html index c2af37994c..b241afd21b 100644 --- a/docs/commands/misc/default-file/index.html +++ b/docs/commands/misc/default-file/index.html @@ -4,7 +4,7 @@ Default File ⚡️ | Scala CLI - + @@ -12,7 +12,7 @@

Default File ⚡️

caution

The Default File is restricted and requires setting the --power option to be used. You can pass it explicitly or set it globally by running:

scala-cli config power true

The default-file sub-command provides sensible default content for files such as .gitignore or for GitHub actions workflows, for Scala CLI projects.

To list the available files, pass it --list:

$ scala-cli default-file --list
.gitignore
.github/workflows/ci.yml

Get the content of a default file with

$ scala-cli default-file .gitignore
/.bsp/
/.scala-build/

Optionally, write the content of one or more default files by passing --write:

$ scala-cli default-file --write .gitignore .github/workflows/ci.yml
Wrote .gitignore
Wrote .github/workflows/ci.yml
- + \ No newline at end of file diff --git a/docs/commands/misc/pgp/index.html b/docs/commands/misc/pgp/index.html index b1360639d1..124af8e5ee 100644 --- a/docs/commands/misc/pgp/index.html +++ b/docs/commands/misc/pgp/index.html @@ -4,7 +4,7 @@ PGP ⚡️ | Scala CLI - + @@ -16,7 +16,7 @@ Note that sub-commands relying on signing, such as publish, also allow signing to be handled using gpg.

Create key pairs

It's not mandatory, although recomended, to use a password to encrypt your keychains.

$ scala-cli pgp create --email alex@alex.me --password env:MY_PASSWORD
Wrote public key e259e7e8a23475b3 to key.pub
Wrote secret key to key.skr

See the dedicated page for the various formats accepted by the --password option.

Get the fingerprint of a public key

$ scala-cli pgp key-id ./key.pub
e259e7e8a23475b3

Push public keys to key servers

$ scala-cli pgp push key.pub
Key 0xe259e7e8a23475b3 uploaded to http://keyserver.ubuntu.com:11371

Pull public keys from key servers

$ scala-cli pgp pull 0x914d298df8fa4d20
-----BEGIN PGP PUBLIC KEY BLOCK-----

-----END PGP PUBLIC KEY BLOCK-----

Sign files

$ scala-cli pgp sign --secret-key file:./key.skr --password value:1234 ./foo
$ cat ./foo.asc
-----BEGIN PGP MESSAGE-----

-----END PGP MESSAGE-----

$ scala-cli pgp sign --secret-key file:./key.skr --password value:1234 ./foo --stdout
-----BEGIN PGP MESSAGE-----

-----END PGP MESSAGE-----

Verify signatures

$ scala-cli pgp verify --key key.pub foo.asc
foo.asc: valid signature
- + \ No newline at end of file diff --git a/docs/commands/package/index.html b/docs/commands/package/index.html index f0ab71faac..06d04a5741 100644 --- a/docs/commands/package/index.html +++ b/docs/commands/package/index.html @@ -4,7 +4,7 @@ Package ⚡️ | Scala CLI - + @@ -29,7 +29,7 @@ To build a RedHat Package, you will need to have rpmbuild installed.

Example:

scala-cli --power package --rpm --output 'path.rpm' Hello.scala

Mandatory arguments

  • version
  • description
  • license
  • output-path

Optional arguments

  • force
  • launcher-app
  • release
  • rpm-architecture

macOS (PKG)

PKG is a software package format for macOS. To build a PKG you will need to have pkgbuild installed.

Example:

`scala-cli --power package --pkg --output 'path.pkg` Hello.scala

Mandatory arguments

  • version
  • identifier
  • output-path

Optional arguments

  • force
  • launcher-app

Windows

MSI is a software package format for Windows. To build an MSI installer, you will need to have WIX Toolset installed.

Example:

scala-cli --power package --msi --output path.msi Hello.scala

Mandatory arguments

  • version
  • maintainer
  • licence-path
  • product-name
  • output-path

Optional arguments

  • force
  • launcher-app
  • exit-dialog
  • logo-path

Using directives

Instead of passing the package options directly from bash, it is possible to pass some of them with using directives.

packaging.packageType

This using directive makes it possible to define the type of the package generated by the package command. For example:

//> using packaging.packageType assembly

Available types: assembly, raw-assembly, bootstrap, library, source, doc, spark, js, native, docker, graalvm, deb, dmg, pkg, rpm, msi.

packaging.output

This using directive makes it possible to define the destination path of the package generated by the package command. For example:

//> using packaging.output foo

The using directive above makes it possible to create a package named foo inside the current directory.

packaging.graalvmArgs

This using directive makes it possible to pass args to GraalVM:

//> using packaging.graalvmArgs --no-fallback --enable-url-protocols=http,https

Docker

packaging.dockerFrom

The using directive allows you to define the base Docker image that is used to run your application.

//> using packaging.dockerFrom openjdk:11

packaging.dockerFrom

The using directive allows you to define the generated Docker image tag.

//> using packaging.dockerImageTag 1.0.0

packaging.dockerImageRegistry

The using directive allows you to define the image registry.

//> using packaging.dockerImageRegistry virtuslab

packaging.dockerImageRegistry

The using directive allows you to define the image repository.

//> using packaging.dockerImageRepository scala-cli
- + \ No newline at end of file diff --git a/docs/commands/publishing/publish-local/index.html b/docs/commands/publishing/publish-local/index.html index 9fb4163753..6de7a73510 100644 --- a/docs/commands/publishing/publish-local/index.html +++ b/docs/commands/publishing/publish-local/index.html @@ -4,7 +4,7 @@ Publish Local ⚡️ | Scala CLI - + @@ -17,7 +17,7 @@ repository usually lives under ~/.ivy2/local, and is taken into account most of the time by most Scala tools when fetching artifacts.

Usage

To publish locally a Scala CLI project, run

scala-cli publish local .
Publishing io.github.scala-cli:hello-scala-cli_3:0.1.0-SNAPSHOT
✔ Computed 10 checksums
🚚 Wrote 15 files

👀 Check results at
~/.ivy2/local/io.github.scala-cli/hello-scala-cli_3/0.1.0-SNAPSHOT/

Required settings

The publish local command needs the same required settings as the publish command. Like for publish, Scala CLI might already be able to compute sensible defaults for those.

- + \ No newline at end of file diff --git a/docs/commands/publishing/publish-setup/index.html b/docs/commands/publishing/publish-setup/index.html index 5c69c192b3..9aa8bf97e6 100644 --- a/docs/commands/publishing/publish-setup/index.html +++ b/docs/commands/publishing/publish-setup/index.html @@ -4,7 +4,7 @@ Publish Setup ⚡️ | Scala CLI - + @@ -46,7 +46,7 @@ should trigger a workflow pushing snapshot artifacts to Sonatype Snapshots.

To publish a non-snapshot version, either push a tag like v0.1.0 (or any other version with a v prefix), or create a release with a tag with the same name from the GitHub UI.

GitHub Packages

In order to setup publishing to GitHub packages, pass --publish-repository github to the publish setup commands above, like

scala-cli --power publish setup . --publish-repository github
- + \ No newline at end of file diff --git a/docs/commands/publishing/publish/index.html b/docs/commands/publishing/publish/index.html index 38f1308700..0d1056f214 100644 --- a/docs/commands/publishing/publish/index.html +++ b/docs/commands/publishing/publish/index.html @@ -4,7 +4,7 @@ Publish ⚡️ | Scala CLI - + @@ -76,7 +76,7 @@ using directives. See user / password / realm in the settings table and the CI overrides.

Publishing

Once all the necessary settings are set, publish a Scala CLI project with a command such as this one:

scala-cli --power publish .

(. is for the Scala CLI project in the current directory)

Publishing io.github.scala-cli:hello-scala-cli_3:0.1.0-SNAPSHOT
✔ Computed 8 checksums
🚚 Wrote 12 files

👀 Check results at
https://s01.oss.sonatype.org/content/repositories/snapshots/io/github/scala-cli/hello-scala-cli_3/0.1.0-SNAPSHOT
- + \ No newline at end of file diff --git a/docs/commands/repl/index.html b/docs/commands/repl/index.html index 93a0b2c8cf..8260f7b4f5 100644 --- a/docs/commands/repl/index.html +++ b/docs/commands/repl/index.html @@ -4,14 +4,15 @@ REPL | Scala CLI - +
-

REPL

The repl command starts a Scala REPL, which lets you interactively run your code and inspect its results:

scala-cli repl
scala> println("Hello Scala")
Hello Scala

scala> :exit

Scala CLI by default uses the normal Scala REPL.

If you prefer to use the Ammonite REPL, specify --amm to launch it rather than the default REPL:

scala-cli repl --amm
Loading...
Welcome to the Ammonite Repl 2.4.0-23-76673f7f (Scala 3.0.2 Java 11.0.11)
@ println("Hello ammonite")
Hello ammonite
@ exit
Bye!

The repl command accepts the same arguments as the compile command. It first compiles any provided sources, and then exposes those results and any provided dependencies to the REPL session:

mylibrary/Messages.scala
package mylibrary

object Messages {
def message = "Hello"
def print(): Unit = println(message)
}
scala-cli repl mylibrary/Messages.scala
Compiling project (Scala 3.0.2, JVM)
Compiled project (Scala 3.0.2, JVM)
scala> import mylibrary._

scala> Messages.print()
Hello

scala> :quit

Inject code as JAR file in class path

If your application inspects its class path, and requires only JAR files in it, use --as-jar to +

REPL

The repl command starts a Scala REPL, which lets you interactively run your code and inspect its results:

scala-cli repl
scala> println("Hello Scala")
Hello Scala

scala> :exit

Scala CLI by default uses the normal Scala REPL.

If you prefer to use the Ammonite REPL, specify --amm to launch it rather than the default REPL:

caution

Using the Ammonite REPL is restricted and requires setting the --power option to be used. +You can pass it explicitly or set it globally by running:

scala-cli config power true
scala-cli --power repl --amm
Loading...
Welcome to the Ammonite Repl 2.4.0-23-76673f7f (Scala 3.0.2 Java 11.0.11)
@ println("Hello ammonite")
Hello ammonite
@ exit
Bye!

The repl command accepts the same arguments as the compile command. It first compiles any provided sources, and then exposes those results and any provided dependencies to the REPL session:

mylibrary/Messages.scala
package mylibrary

object Messages {
def message = "Hello"
def print(): Unit = println(message)
}
scala-cli repl mylibrary/Messages.scala
Compiling project (Scala 3.0.2, JVM)
Compiled project (Scala 3.0.2, JVM)
scala> import mylibrary._

scala> Messages.print()
Hello

scala> :quit

Inject code as JAR file in class path

If your application inspects its class path, and requires only JAR files in it, use --as-jar to put the Scala CLI project in the class path as a JAR file rather than as a directory:

scala-cli repl Foo.scala --as-jar
- + \ No newline at end of file diff --git a/docs/commands/run/index.html b/docs/commands/run/index.html index 95b726f544..68bb6d5dcf 100644 --- a/docs/commands/run/index.html +++ b/docs/commands/run/index.html @@ -4,7 +4,7 @@ Run | Scala CLI - + @@ -24,7 +24,7 @@ passed, Scala CLI throws an error.

Scala Scripts

Scala CLI can also compile and run Scala scripts:

HelloScript.sc
#!/ usr / bin / env -S scala -cli shebang

println("Hello world from scala script")
scala-cli run HelloScript.sc
Hello world from scala script

Our scripts guide provides many more details.

Scala CLI from docker

Scala applications can also be compiled and run using a docker image with Scala CLI, without needing to install Scala CLI manually:

docker run virtuslab/scala-cli:latest version
HelloWorld.scala
object HelloWorld extends App {
println("Hello world")
}
docker run  -v $(pwd)/HelloWorld.scala:/HelloWorld.scala virtuslab/scala-cli /HelloWorld.scala
Hello world

Debugging

It is possible to debug code by passing --debug flag.

Additional debug options:

  • --debug-mode (attach by default)
  • --debug-port (5005 by default)

Available debug modes:

  • Attach (attach | att | a)
  • Listen (listen | lis | l)

Example debugging with scala-cli:

scala-cli Foo.scala --debug --debug-mode l --debug-port 5006

Inject code as JAR file in class path

If your application inspects its class path, and requires only JAR files in it, use --as-jar to put the Scala CLI project in the class path as a JAR file rather than as a directory:

scala-cli Foo.scala --as-jar
- + \ No newline at end of file diff --git a/docs/commands/setup-ide/index.html b/docs/commands/setup-ide/index.html index 52b782967e..a5b840436f 100644 --- a/docs/commands/setup-ide/index.html +++ b/docs/commands/setup-ide/index.html @@ -4,7 +4,7 @@ IDE Setup | Scala CLI - + @@ -13,7 +13,7 @@ As a result, in most cases you don't need to run this command manually.

But if you want to, invoke setup-ide like:

scala-cli setup-ide . --scala 2.13

Keep in mind that if you change any of these options, you may need to restart your IDE, or re-import your project.

IDE support internals

After invoking setup-ide, two files should be generated:

  • .bsp/scala-cli.json
  • .scala-build/ide-options-v2.json

The first file is specifically created for Build Server Protocol (BSP) support in your IDE. BSP is supported by VS Code (via the Metals extension) and IntelliJ (with the Scala plugin), and defines the way in which IDEs gather information about the project you are working on.

The second file is designed to store settings used by the Scala CLI while generating BSP configuration. This includes all options, such as the Scala version, custom arguments, and more, but fortunately you shouldn't need to edit it.

- + \ No newline at end of file diff --git a/docs/commands/shebang/index.html b/docs/commands/shebang/index.html index 2caa8c8c19..d16f510b2c 100644 --- a/docs/commands/shebang/index.html +++ b/docs/commands/shebang/index.html @@ -4,7 +4,7 @@ Shebang | Scala CLI - + @@ -15,7 +15,7 @@ Note that those files are always run as scripts even though they may contain e.g. valid .scala program.

Normally, inputs and Scala CLI options can be mixed. Program arguments (to be passed to your app) have to be specified after -- (double dash) separator.

scala-cli [command] [scala_cli_options | input]... -- [program_arguments]...

For the shebang command, only a single input can be set. All Scala CLI options must be set before the input, while everything after the input is considered a program argument.

scala-cli shebang [scala_cli_options]... input [program_arguments]...

More details can be found in Shebang guide.

- + \ No newline at end of file diff --git a/docs/commands/test/index.html b/docs/commands/test/index.html index 19fb3a55b1..00e55d3ae0 100644 --- a/docs/commands/test/index.html +++ b/docs/commands/test/index.html @@ -4,7 +4,7 @@ Test | Scala CLI - + @@ -28,7 +28,7 @@ a dedicated interface: com.github.sbt:junit-interface:0.13.3
  • Weaver: com.disneystreaming::weaver-cats:0.8.3. You may need to specify weaver's test framework with //> using testFramework "weaver.framework.CatsEffect" if you had other test framework in your dependencies.
  • The following example shows how to run an munit-based test suite:

    MyTests.test.scala
    //> using test.dep org.scalameta::munit::0.7.29

    class MyTests extends munit.FunSuite {
    test("foo") {
    assert(2 + 2 == 4)
    }
    }
    scala-cli test MyTests.test.scala
    Compiling project (1 Scala source)
    Compiled project
    MyTests:
    + foo 0.143s

    Filter test suite

    Passing the --test-only option to the test sub-command filters the test suites to be run:

    BarTests.test.scala
    //> using test.dep org.scalameta::munit::0.7.29
    package tests.only

    class BarTests extends munit.FunSuite {
    test("bar") {
    assert(2 + 3 == 5)
    }
    }
    HelloTests.test.scala
    package tests

    class HelloTests extends munit.FunSuite {
    test("hello") {
    assert(2 + 2 == 4)
    }
    }
    scala-cli test . --test-only 'tests.only*' 
    # tests.only.BarTests:
    # + bar 0.045s

    Filter test case

    Munit

    To run a specific test case inside the unit test suite pass *exact-test-name* as an argument to scala-cli:

    BarTests.test.scala
    //> using test.dep org.scalameta::munit::0.7.29
    package tests.only

    class Tests extends munit.FunSuite {
    test("bar") {
    assert(2 + 2 == 5)
    }
    test("foo") {
    assert(2 + 3 == 5)
    }
    test("foo-again") {
    assert(2 + 3 == 5)
    }
    }
    scala-cli test . --test-only 'tests.only*'  -- '*foo*'
    # tests.only.Tests:
    # + foo 0.045s
    # + foo-again 0.001s

    Test arguments

    You can pass test arguments to your test framework by passing them after --:

    MyTests.test.scala
    //> using test.dep org.scalatest::scalatest::3.2.9

    import org.scalatest._
    import org.scalatest.flatspec._
    import org.scalatest.matchers._

    class Tests extends AnyFlatSpec with should.Matchers {
    "A thing" should "thing" in {
    assert(2 + 2 == 4)
    }
    }
    scala-cli test MyTests.test.scala -- -oD
    Compiling project (1 Scala source)
    Compiled project
    Tests:
    A thing
    - should thing (22 milliseconds)
    Run completed in 359 milliseconds.
    Total number of tests run: 1
    Suites: completed 1, aborted 0
    Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0
    All tests passed.
    - + \ No newline at end of file diff --git a/docs/commands/version/index.html b/docs/commands/version/index.html index f121a75cd6..60d116dcdb 100644 --- a/docs/commands/version/index.html +++ b/docs/commands/version/index.html @@ -4,7 +4,7 @@ Version | Scala CLI - + @@ -16,7 +16,7 @@ do different things. The former prints the raw Scala CLI version, while the latter allows to change the Scala CLI launcher version. In fact, both of them can be used at one time.

    scala-cli --cli-version 0.1.18 version --cli-version
    0.1.18

    Launcher options have to be passed before the sub-command is specified, which allows to differentiate between them.

    Similarly, it's possible to just print the raw default Scala version. Once more, this won't check if the app is outdated, so the --offline option is unnecessary in this context as well.

    scala-cli version --scala-version
    3.2.1
    - + \ No newline at end of file diff --git a/docs/cookbooks/debugging/index.html b/docs/cookbooks/debugging/index.html index b415d43d9a..b02b4e8725 100644 --- a/docs/cookbooks/debugging/index.html +++ b/docs/cookbooks/debugging/index.html @@ -4,13 +4,13 @@ Debugging with Scala CLI | Scala CLI - +

    Debugging with Scala CLI

    Debugging with Scala CLI is very simple. All one needs to do is to pass the --debug option, which is available for the run and test sub-commands.

    Preparing files to debug

    Let's start with creating a few example files, which we will run and debug later on:

    MyClass.scala
    object MyClass extends App  {
    println("Line 1")
    println("Line 2")
    println("Line 3")
    }
    MyTests.test.scala
    //> using dep org.scalameta::munit::0.7.27

    class MyTests extends munit.FunSuite {
    test("foo") {
    assert(2 + 2 == 4)
    }
    }

    VS Code with Metals

    Configuration

    If you are using VS Code with Metals, you will have to define launch configurations in the launch.json file inside the .vscode directory.

    Within each configuration you will have to define the following configuration attributes: type, request, name, buildTarget, hostName and port.

    If you don't know what are the exact build target names of your project, you can check them in Metals Doctor in the Build target column:

    Metals Doctor view

    If no build targets have been found, perform the following steps:

    • run scala-cli compile . in the command line.
    • when the compilation is complete, run Connect to build server in the Metals build commands section.

    After these steps, build targets should be visible in the Metals Doctor view.

    Example launch.json configuration file:

    .vscode/launch.json
    {
    "version": "0.2.0",
    "configurations": [
    {
    "type": "scala",
    "request": "attach",
    "name": "project",
    "buildTarget": "project_183d125c5c",
    "hostName": "localhost",
    "port": 5005
    },
    {
    "type": "scala",
    "request": "attach",
    "name": "project-test",
    "buildTarget": "project_183d125c5c-test",
    "hostName": "localhost",
    "port": 5005
    }
    ]
    }

    After defining configurations in the launch.json file, you should be able to see them in Configuration dropdown in the Run and Debug view:

    Configuration dropdown

    After setting up the configuration you can proceed to debugging.

    Debugging

    Set breakpoints for the file you would like to debug:

    Setting breakpoints

    Run one of the following commands depending on which file you would like to debug:

    • run scala-cli MyClass.scala --debug if you would like to debug MyClass.scala file
    • run scala-cli test MyTests.test.scala --debug if you would like to debug MyTests.test.scala file

    After compilation is completed, Scala CLI should stop and listen for transport dt_socket at port 5005.

    info

    Please note that 5005 is the default port for debugging with scala-cli. You can always change it by passing --debug-port option.

    At this moment go to the Run and Debug view, select proper configuration from the Configuration dropdown and run debugger by clicking green arrow on the side:

    Running debugger

    After all these steps, the debugger should stop at the first breakpoint and you can proceed to debugging your code using all features delivered by VS Code. For more information check this guide.

    IntelliJ IDEA

    Debugging in the attach mode

    The first thing that you need to do to start debugging is setting breakpoints for the files you want to debug:

    Setting breakpoints

    Run one of the following commands depending on which file you would like to debug:

    • run scala-cli MyClass.scala --debug if you would like to debug MyClass.scala file
    • run scala-cli test MyTests.test.scala --debug if you would like to debug MyTests.test.scala file

    After compilation is completed, Scala CLI should stop and listen for transport dt_socket at port 5005.

    info

    Please note that 5005 is the default port for debugging with scala-cli. You can always change it by passing --debug-port option.

    At this moment, you can attach to process by clicking Run -> Attach to Process and choosing process, which is running at port 5005:

    Attach to Process

    After all these steps, the debugger should stop at the first breakpoint and you can proceed to debug your code using all features delivered by IntelliJ IDEA. For more information check this guide.

    Debugging in the listen mode

    If you would like to debug in listen mode, add a new Remote JVM Debug configuration with the following setup:

    Listen mode configuration

    Set breakpoints for the files you want to debug:

    Setting breakpoints

    Run the previously set configuration by clicking on the green debug button on the side:

    Running debug configuration

    Run one of the following commands depending on which file you would like to debug:

    • run scala-cli MyClass.scala --debug-mode listen if you would like to debug MyClass.scala file
    • run scala-cli test MyTests.test.scala --debug-mode listen if you would like to debug MyTests.test.scala file
    info

    attach is the default mode for debugging with Scala CLI. You can always change it by passing --debug-mode option. Available modes are: attach and listen.

    After all these steps the debugger should stop at the first breakpoint and you can proceed to debug your code using all features delivered by IntelliJ IDEA. For more information check this guide.

    - + \ No newline at end of file diff --git a/docs/cookbooks/gh-action/index.html b/docs/cookbooks/gh-action/index.html index 1001886213..eb84a652bb 100644 --- a/docs/cookbooks/gh-action/index.html +++ b/docs/cookbooks/gh-action/index.html @@ -4,14 +4,14 @@ Use Scala CLI in GitHub Actions | Scala CLI - +

    Use Scala CLI in GitHub Actions

    Preparing simple aplication

    Scala CLI lets you run, test, and package Scala code in various environments, including GitHub CI. To use Scala CLI features in a simple way you can use the GitHub Actions scala-cli-setup that installs everything necessary to run your Scala CLI application and more.

    For example, here's a simple ls application printing the files in a given directory:

    Ls.scala
    //> using scala 2.13
    //> using dep com.lihaoyi::os-lib:0.7.8

    @main def hello(args: String*) =
    val path = args.headOption match
    case Some(p) => os.Path(p, os.pwd)
    case _ => os.pwd

    if (os.isDir(path)) println(os.list(path).mkString(","))
    else System.err.println("Expected directory path as an input")

    and some tests for ls application:

    TestsLs.test.scala
    //> using dep org.scalameta::munit::0.7.27
    import scala.util.Properties

    class TestsLs extends munit.FunSuite {
    test("ls") {
    // prepare test directory
    val tempDir = os.temp.dir()
    // create files
    val expectedFiles = Seq("Ls", "Hello").map(tempDir / _)
    expectedFiles.foreach(os.write(_, "Hello"))

    // check
    val scalaCLILauncher = if(Properties.isWin) "scala-cli.bat" else "scala-cli"
    val foundFiles =
    os.proc(scalaCLILauncher, "Ls.scala", "--", tempDir).call().out.trim()

    expectedFiles.map(_.toString).foreach { file =>
    assert(foundFiles.contains(file))
    }
    }
    }

    Run tests in Github CI

    The following configuration of ci.yml contains a definition of job that runs tests using Scala CLI for every platform defined in matrix.OS.

    jobs:
    build:
    runs-on: ${{ matrix.OS }}
    strategy:
    matrix:
    OS: ["ubuntu-latest", "macos-latest", "windows-latest"]
    steps:
    - uses: actions/checkout@v3
    with:
    fetch-depth: 0
    - uses: coursier/cache-action@v6.3
    - uses: VirtusLab/scala-cli-setup@v0.1
    - run: scala-cli test .

    Check your Scala code format

    To check the code style of your sources, you can use Scalafmt.

    To check your code format in GitHub CI by adding new job format:

      format:
    runs-on: "ubuntu-latest"
    steps:
    - uses: actions/checkout@v3
    with:
    fetch-depth: 0
    - uses: coursier/cache-action@v6.3
    - uses: VirtusLab/scala-cli-setup@v0.1
    - name: Scalafmt check
    run: |
    scala-cli fmt --check . || (
    echo "To format code run"
    echo " scala-cli fmt ."
    exit 1
    )

    If the scala-cli fmt --check . command fails, it can be easily fixed by running scala-cli fmt ., which correctly formats your code.

    Package your application

    Scala CLI allows to build native executable applications using GraalVM, which can be uploaded as GitHub release artifacts.

        - name: Package app
    run: scala-cli .github/scripts/package.sc

    Given this simple Scala Script package.sc to package application to every platform:

    package.sc
    //> using scala 3.1.2
    //> using dep com.lihaoyi::os-lib:0.8.0
    import scala.util.Properties

    val platformSuffix: String = {
    val os =
    if (Properties.isWin) "pc-win32"
    else if (Properties.isLinux) "pc-linux"
    else if (Properties.isMac) "apple-darwin"
    else sys.error(s"Unrecognized OS: ${sys.props("os.name")}")
    os
    }
    val artifactsPath = os.Path("artifacts", os.pwd)
    val destPath =
    if (Properties.isWin) artifactsPath / s"ls-$platformSuffix.exe"
    else artifactsPath / s"ls-$platformSuffix"
    val scalaCLILauncher =
    if (Properties.isWin) "scala-cli.bat" else "scala-cli"

    os.makeDir(artifactsPath)
    os.proc(scalaCLILauncher,"--power", "package", ".", "-o", destPath, "--native-image")
    .call(cwd = os.pwd)
    .out
    .text()
    .trim

    Distribute generated native application

    To upload generated native executable applications to artifacts you can use upload-artifact GitHub Actions.

        - uses: actions/upload-artifact@v3
    with:
    name: launchers
    path: artifacts
    if-no-files-found: error
    retention-days: 2

    When release CI pass, you should be able to download artifacts that contain native launchers of your applications.

    Here you can find examples of a CI that contains generated launcher based on this cookbook.

    You can find the code of this cookbook here.

    - + \ No newline at end of file diff --git a/docs/cookbooks/gists/index.html b/docs/cookbooks/gists/index.html index f2126e70c0..6894f79030 100644 --- a/docs/cookbooks/gists/index.html +++ b/docs/cookbooks/gists/index.html @@ -4,7 +4,7 @@ Sharing and testing code with GitHub gists | Scala CLI - + @@ -17,7 +17,7 @@ You can enable including non-explicit .md inputs by passing the --enable-markdown option.

    It is possible to run markdown sources from a GitHub gist. The gist is technically treated as a zipped archive (which it is downloaded as), so it is necessary to pass the --enable-markdown option alongside the gist URL to run any contained Markdown sources.

    scala-cli --power https://gist.github.com/Gedochao/6415211eeb8ca4d8d6db123f83f0f839 --enable-markdown
    Hello

    You can find more information on working with Markdown in the Markdown guide.

    - + \ No newline at end of file diff --git a/docs/cookbooks/instant-startup-scala-scripts/index.html b/docs/cookbooks/instant-startup-scala-scripts/index.html index 0904b72e0a..2af852167d 100644 --- a/docs/cookbooks/instant-startup-scala-scripts/index.html +++ b/docs/cookbooks/instant-startup-scala-scripts/index.html @@ -4,7 +4,7 @@ Scala Scripts with instant startup | Scala CLI - + @@ -20,7 +20,7 @@ in this case, by including an additional using directive:

    size-higher-than.scala
    //> using scala 3.1.1
    //> using dep com.lihaoyi::os-lib::0.8.1
    //> using platform scala-native

    @main
    def sizeHigherThan(dir: String, minSizeMB: Int) =
    val wd = os.pwd / dir
    val files = os.walk.attrs(wd).collect{
    case (p, attrs) if attrs.size > minSizeMB * 10E6 => p
    }
    files.foreach(println(_))

    After rerunning, you may notice that while the initial compilation took a little longer, subsequent runs will severely cut on the startup time compared to the JVM.

    Optimization options

    We can make the runtime itself even faster, using various Scala Native optimization options:

    • debug - what was used by default up to this point, fast compilation with a slower runtime
    • release-fast - moderate compilation time with a faster runtime
    • release-full - slow compilation time with the fastest runtime

    We pass these using a -–native-mode scala-cli option or, like previously, by adding a using directive:

    size-higher-than.scala
    //> using scala 3.1.1
    //> using dep com.lihaoyi::os-lib::0.8.1
    //> using platform scala-native
    //> using nativeMode release-full

    @main
    def sizeHigherThan(dir: String, minSizeMB: Int) =
    val wd = os.pwd / dir
    val files = os.walk.attrs(wd).collect{
    case (p, attrs) if attrs.size > minSizeMB * 10E6 => p
    }
    files.foreach(println(_))

    We can also package this script into a separate binary with the package command, useful especially on Windows where typically shebangs won’t work:

    Additional considerations

    Some things to look out for when working with Scala Native:

    • dependencies - libraries have to be published separately for Scala Native. Notice the org::project::version double colon syntax used for os-lib - it basically hides org::project_native[Scala Native binary version]:version underneath. Fortunately, many libraries are already available for Scala Native. However, Java dependencies will not work altogether.
    • some differences exist when compared to Scala on the JVM.
    - + \ No newline at end of file diff --git a/docs/cookbooks/intellij-multi-bsp/index.html b/docs/cookbooks/intellij-multi-bsp/index.html index 8a80e759a8..dc09d59aa4 100644 --- a/docs/cookbooks/intellij-multi-bsp/index.html +++ b/docs/cookbooks/intellij-multi-bsp/index.html @@ -4,7 +4,7 @@ Setup multiple Scala CLI projects in IDEA IntelliJ as separate modules | Scala CLI - + @@ -24,7 +24,7 @@ if the setup-ide was run correctly).

    Import from BSP as external model

    You have to import each of the subdirectories separately (app1, app2 and scripts, in the example).

    The end result should look like this:

    End result multi-BSP setup

    Now each of the subdirectories uses its own BSP connection, which in turn means a separate classpath. And all of that in a single IntelliJ project!

    Upon closer inspection, you may notice that IntelliJ stores this as separate sub-project configurations. Each subdirectory gets its own .idea folder with the relevant settings.

    tree -a
    .
    ├── .idea
    │   ├── .gitignore
    │   ├── bsp.xml
    │   ├── codeStyles
    │   │   ├── Project.xml
    │   │   └── codeStyleConfig.xml
    │   ├── intellij-multi-bsp.iml
    │   ├── misc.xml
    │   ├── modules.xml
    │   ├── sbt.xml
    │   ├── vcs.xml
    │   └── workspace.xml
    ├── app1
    │   ├── .bsp
    │   │   └── scala-cli.json
    │   ├── .idea
    │   │   └── modules
    │   │   └── app1-root.iml
    │   ├── .scala-build
    │   │   ├── ide-inputs.json
    │   │   └── ide-options-v2.json
    │   ├── src
    │   │   └── HelloWorld1.scala
    │   └── test
    │   └── MyTests1.test.scala
    ├── app2
    │   ├── .bsp
    │   │   └── scala-cli.json
    │   ├── .idea
    │   │   └── modules
    │   │   └── app2-root.iml
    │   ├── .scala-build
    │   │   ├── ide-inputs.json
    │   │   └── ide-options-v2.json
    │   ├── src
    │   │   └── HelloWorld2.scala
    │   └── test
    │   └── MyTests2.test.scala
    └── scripts
    ├── .bsp
    │   └── scala-cli.json
    ├── .idea
    │   └── modules
    │   └── scripts-root.iml
    ├── .scala-build
    │   ├── ide-inputs.json
    │   └── ide-options-v2.json
    ├── AnotherScript.sc
    └── SomeScript.sc

    21 directories, 28 files
    - + \ No newline at end of file diff --git a/docs/cookbooks/intellij-sbt-with-bsp/index.html b/docs/cookbooks/intellij-sbt-with-bsp/index.html index 7af787460b..2248b2420a 100644 --- a/docs/cookbooks/intellij-sbt-with-bsp/index.html +++ b/docs/cookbooks/intellij-sbt-with-bsp/index.html @@ -4,7 +4,7 @@ Setup a Scala CLI project in IntelliJ alongside your existing SBT project | Scala CLI - + @@ -19,7 +19,7 @@ Now, right-click on your project root directory in IntelliJ and go into Module Settings

    Go into Module Settings

    Then, under Project Structure -> Modules press the + button and then Import Module.

    Import a module

    Navigate to the scripts directory from there and add it as a BSP module (BSP should be an available choice, if the setup-ide command was run correctly).

    Import from BSP as external model

    Now the scripts BSP module should be imported and you should be able to run the scripts from your IDE. The end result should look like this:

    Import from BSP as external model

    - + \ No newline at end of file diff --git a/docs/cookbooks/intellij/index.html b/docs/cookbooks/intellij/index.html index 9850fcf4eb..2d3c48acc6 100644 --- a/docs/cookbooks/intellij/index.html +++ b/docs/cookbooks/intellij/index.html @@ -4,7 +4,7 @@ Setup a Scala CLI project in IDEA IntelliJ | Scala CLI - + @@ -25,7 +25,7 @@ what is encouraged by IDEA IntelliJ, which assumes by default that tests should have its own directory. However, nothing really forces you to bother with that, you can put everything in the root directory (or anywhere else, really), and it should (mostly) work fine:

    tree -a
    .
    ├── HelloWorld.scala
    └── MyTests.test.scala

    Scala CLI flat project structure imported to IntelliJ

    - + \ No newline at end of file diff --git a/docs/cookbooks/intro/index.html b/docs/cookbooks/intro/index.html index ed67767b96..1f90365e58 100644 --- a/docs/cookbooks/intro/index.html +++ b/docs/cookbooks/intro/index.html @@ -4,14 +4,14 @@ Introduction | Scala CLI - +
    - + \ No newline at end of file diff --git a/docs/cookbooks/native-images/index.html b/docs/cookbooks/native-images/index.html index 2b5cb2a91b..fa889e08de 100644 --- a/docs/cookbooks/native-images/index.html +++ b/docs/cookbooks/native-images/index.html @@ -4,7 +4,7 @@ Packaging Scala applications as GraalVM native images | Scala CLI - + @@ -12,7 +12,7 @@

    Packaging Scala applications as GraalVM native images

    Scala CLI lets you package your applications as native executables using GraalVM native images.

    As an example, let's package the following application as a native executable using GraalVM native image:

    Echo.scala
    object Echo {
    def main(args: Array[String]): Unit =
    println(args.mkString(" "))
    }

    The following command packages this application as a native executable:

    scala-cli --power package --native-image Echo.scala -o echo
    # Run echo on macOS
    ./echo a b
    # a b

    You can pass custom options to GraalVM native image by passing them after --, like

    scala-cli --power package --native-image Echo.scala -o echo -- --no-fallback
    - + \ No newline at end of file diff --git a/docs/cookbooks/scala-docker/index.html b/docs/cookbooks/scala-docker/index.html index 44685647e2..f5866ab3dc 100644 --- a/docs/cookbooks/scala-docker/index.html +++ b/docs/cookbooks/scala-docker/index.html @@ -4,14 +4,14 @@ Packaging Scala applications as Docker images | Scala CLI - +

    Packaging Scala applications as Docker images

    Scala CLI can create an executable application and package it into a Docker image.

    For example, here's a simple piece of code that will be executed in a Docker container:

    HelloDocker.scala
    object HelloDocker extends App {
    println("Hello from Docker")
    }

    Passing --docker to the package sub-command generates a Docker image. When creating a Docker image, the --docker-image-repository parameter is mandatory.

    The following command generates a hello-docker image with the latest tag:

    scala-cli --power package --docker HelloDocker.scala --docker-image-repository hello-docker
    docker run hello-docker
    # Hello from Docker

    You can also package your app in the Scala.js or Scala Native environments. For example, this command creates a Scala.js Docker image:

    scala-cli --power package --js --docker HelloDocker.scala --docker-image-repository hello-docker

    This command creates a Scala Native Docker image:

    scala-cli --power package --native --docker HelloDocker.scala --docker-image-repository hello-docker
    note

    Packaging a Scala Native application to a Docker image is supported only on Linux.

    - + \ No newline at end of file diff --git a/docs/cookbooks/scala-jvm/index.html b/docs/cookbooks/scala-jvm/index.html index bd25d75fa6..8a6c12fdd4 100644 --- a/docs/cookbooks/scala-jvm/index.html +++ b/docs/cookbooks/scala-jvm/index.html @@ -4,14 +4,14 @@ Testing your code with different Java versions | Scala CLI - +

    Testing your code with different Java versions

    You can use Scala CLI to test your code compatibility with various versions of java, with a key point being that manual installation of a JDK/SDK is not required(!). Scala CLI automatically downloads the Java version you specify.

    As an example, the following snippet uses the new method Files.writeString from Java 11:

    Main.scala
    import java.nio.file.Files
    import java.nio.file.Paths

    object Main extends App {
    val dest = Files.createTempDirectory("scala-cli-demo").resolve("hello.txt")
    val filePath = Files.writeString(dest, "Hello from ScalaCli")
    val fileContent: String = Files.readString(filePath)
    println(fileContent)
    }

    To use Java 11 to run this application, pass the following --jvm option to the Scala CLI command:

    scala-cli --jvm adopt:11 Main.scala

    To attempt to compile the application with Java 8, change the value of the --jvm parameter:

    scala-cli --jvm 8 Main.scala
    # In this case, it raises an error because the `Files.createTempFile` method is not available in java 8
    #
    # Exception in thread main: java.lang.Exception: java.lang.NoSuchMethodError: java.nio.file.Files.writeString(Ljava/nio/file/Path;Ljava/lang/CharSequence;[Ljava/nio/file/OpenOption;)Ljava/nio/file/Path;
    # at method print in modules/runner/src/main/scala-3-stable/scala/cli/runner/Stacktrace.scala:12 inside runner_3.jar
    # at method printException in modules/runner/src/main/scala/scala/cli/runner/StackTracePrinter.scala:91 inside runner_3.jar
    # at method main in modules/runner/src/main/scala/scala/cli/runner/Runner.scala:22 inside runner_3.jar
    - + \ No newline at end of file diff --git a/docs/cookbooks/scala-package/index.html b/docs/cookbooks/scala-package/index.html index be85e869c7..92c8eec623 100644 --- a/docs/cookbooks/scala-package/index.html +++ b/docs/cookbooks/scala-package/index.html @@ -4,7 +4,7 @@ Packaging Scala applications as executable files | Scala CLI - + @@ -13,7 +13,7 @@ The JAR file only contains the byte code that’s generated from your source code files, and automatically downloads its dependencies on its first run.

    As an example, the following snippet contains a short application to detect the OS:

    DetectOsApp.scala
    object DetectOsApp extends App  {
    def getOperatingSystem(): String = {
    val os: String = System.getProperty("os.name")
    os
    }
    println(s"os: ${getOperatingSystem()}")
    }

    Default format (lightweight launcher)

    By default, the package sub-command generates a lightweight JAR that contains only your bytecode. This is how you create a lightweight JAR named DetectOsApp.jar:

    scala-cli --power package DetectOsApp.scala

    Lightweight JARs require the java command to be available, and access to the internet, if dependencies need to be downloaded. This is how you run it on macOS:

    # Run DetectOsApp on macOS
    ./DetectOsApp
    # os: Mac OS X

    The lightweight JAR that was just built on macOS can also run on Linux:

    # Run DetectOsApp on Linux
    ./DetectOsApp
    # os: Linux

    Scala CLI supports building Lightweight JARs in the macOS, Linux, and Windows environments. JARs built on macOS and Linux are portable between these two operating systems. Lightweight JARs built on Windows can only be run on Windows.

    Assemblies

    Passing --assembly to the package sub-command generates so-called "assemblies," or "fat JARs":

    scala-cli --power package --assembly DetectOsApp.scala

    Assemblies also require the java command to be available in the PATH. But in this case, all of the dependencies that are needed are packaged into the assembly, so nothing gets downloaded upon the first run, and no internet access is required.

    # Run DetectOsApp on macOS
    ./DetectOsApp
    # os: Mac OS X
    - + \ No newline at end of file diff --git a/docs/cookbooks/scala-scripts/index.html b/docs/cookbooks/scala-scripts/index.html index cc288bf782..7655437a29 100644 --- a/docs/cookbooks/scala-scripts/index.html +++ b/docs/cookbooks/scala-scripts/index.html @@ -4,7 +4,7 @@ Using Scala CLI to run Scala Scripts | Scala CLI - + @@ -12,7 +12,7 @@

    Using Scala CLI to run Scala Scripts

    Scala Scripts

    Scala scripts are files that contain Scala code without a main method. These source code files don't require build-tool configurations. To run Scala scripts very quickly without waiting the need for build tools, use Scala CLI.

    Run

    For example, given this simple script:

    HelloScript.sc
    val sv = scala.util.Properties.versionNumberString

    val message = s"Hello from Scala ${sv}, Java ${System.getProperty("java.version")}"
    println(message)

    You can run it directly with Scala CLI — there's no need for a build tool or additional configuration:

    scala-cli run HelloScript.sc

    Alternatively, you can add a "shebang" header to your script, make it executable, and execute it directly with Scala CLI. For example, given this script with a header that invokes Scala CLI:

    HelloScriptSheBang.sc
    #!/usr/bin/env -S scala-cli shebang

    val sv = scala.util.Properties.versionNumberString

    def printMessage(): Unit =
    val message = s"Hello from Scala ${sv}, Java ${System.getProperty("java.version")}"
    println(message)

    printMessage()

    You can make it executable and then run it like this:

    chmod +x HelloScriptSheBang.sc
    ./HelloScriptSheBang.sc
    # Hello from Scala 2.13.6, Java 16.0.1

    You can also pass command line arguments to Scala scripts:

    ScriptArguments.sc
    #!/usr/bin/env -S scala-cli shebang
    println(args(1))
    chmod +x ScriptArguments.sc
    ./ScriptArguments.sc foo bar
    # bar

    As shown, command line arguments are accessed through the special args variable.

    Features

    All of the features shown for non-scripts work for Scala scripts as well, such as waiting for changes (watch mode), dependency menagement, packaging, compiling, etc.

    Package

    For example, run the package sub-command to package your script as a lightweight executable JAR file:

    scala-cli --power package HelloScript.sc
    ./HelloScript

    Watch mode

    As another example, pass --watch to Scala CLI to watch all source files for changes, and then re-run them when there is a change:

    scala-cli --watch HelloScript.sc
    - + \ No newline at end of file diff --git a/docs/cookbooks/scala-versions/index.html b/docs/cookbooks/scala-versions/index.html index 262dcd737b..495bd3cfd6 100644 --- a/docs/cookbooks/scala-versions/index.html +++ b/docs/cookbooks/scala-versions/index.html @@ -4,7 +4,7 @@ Picking the Scala version with Scala CLI | Scala CLI - + @@ -13,7 +13,7 @@ The code is a bit complicated, so we suggest that you skip reading the whole file, and just focus on what it prints:

    ScalaVersion.scala
    object ScalaVersion extends App {
    def props(url: java.net.URL): java.util.Properties = {
    val properties = new java.util.Properties()
    val is = url.openStream()
    try {
    properties.load(is)
    properties
    } finally is.close()
    }

    def scala2Version: String =
    props(getClass.getResource("/library.properties")).getProperty("version.number")

    def checkScala3(res: java.util.Enumeration[java.net.URL]): String =
    if (!res.hasMoreElements) scala2Version else {
    val manifest = props(res.nextElement)
    manifest.getProperty("Specification-Title") match {
    case "scala3-library-bootstrapped" =>
    manifest.getProperty("Implementation-Version")
    case _ => checkScala3(res)
    }
    }
    val manifests = getClass.getClassLoader.getResources("META-INF/MANIFEST.MF")

    val scalaVersion = checkScala3(manifests)
    val javaVersion = System.getProperty("java.version")

    println(s"Scala: $scalaVersion")
    }

    When this application is run without specifying a Scala version, it uses the latest stable release of Scala — 3.1.0 at the time of writing this doc:

    scala-cli ScalaVersion.scala

    When you want to control the Scala version, you can control it from the command line using the --scala option (with -S and --scala-version aliases):

    scala-cli -S 2.13.5 ScalaVersion.scala

    In many cases you won't care for a precise Scala version and will want "any Scala 2" or "any 2.13 release." For this situation, Scala CLI accepts version prefixes like this:

    scala-cli -S 2 ScalaVersion.scala

    and this:

    scala-cli -S 2.12 ScalaVersion.scala

    In the first example (-S 2), the application picks up the latest Scala 2 stable release (2.13.9 at the time of this writing). In the second example, the application picks up the latest stable release of 2.12 (which is 2.12.18 at the time of this writing).

    You can also pin the version of the language within a .scala file with using directives.

    info

    The using directives syntax is still experimental, and may change in future versions of Scala CLI.

    Here’s an example of a source code file named version.scala that contains a using directive:

    version.scala
    //> using scala 2.12

    object OldCode
    //rest of the config

    Now when you compile that code along with the previous ScalaVersion.scala file:

    scala-cli ScalaVersion.scala version.scala

    The output at the time of this writing is "2.12.18".

    The Scala CLI philosophy is “command line first,” so any configuration information that’s passed to the command line will override using directives. So when you run this command with the -S option:

    scala-cli -S 2.13.10 ScalaVersion.scala version.scala

    the result is "2.13.10" (as opposed to "2.12.18" in the previous example).

    note

    See our Using Directives Guide for more details on using directives.

    When should I provide a full version of Scala?

    For prototyping, scripting, and other use cases that won’t need to be run multiple times in the future, providing a Scala version generally isn’t necessary.

    Scala is source and binary compatible within each major version (e.g., 2.12.x or 3.1.x) so specifying the version in epoch.major form (e.g., 2.12, 2.13, or 3.1) should be perfectly fine for most use cases. When your Scala code contains more advanced features that may be more sensitive for changes in minor version (e.g., from 2.13.4 to 2.13.5) we recommend specifying the complete Scala version.

    - + \ No newline at end of file diff --git a/docs/cookbooks/test-only/index.html b/docs/cookbooks/test-only/index.html index 3d0a65c5ab..9ad419a0c8 100644 --- a/docs/cookbooks/test-only/index.html +++ b/docs/cookbooks/test-only/index.html @@ -4,7 +4,7 @@ Filter the test suites to run | Scala CLI - + @@ -13,7 +13,7 @@ specifically when using the munit and utest test frameworks.

    Filter the test suites

    The --test-only option in Scala CLI supports using glob patterns to filter test suites to run. A glob pattern is a string which contains asterisk * characters to match a set of test suites.

    Here are three examples of glob patterns for how to filter test suites with --test-only:

    • start with test - test*
    • end with test - *test
    • contains test - *test*
    note

    The --test-only option is supported for every test framework running with Scala CLI.

    For example, passing tests.only* to the --test-only option runs only the test suites which start with tests.only:

    BarTests.scala
    //> using dep org.scalameta::munit::0.7.29
    package tests.only

    class BarTests extends munit.FunSuite {
    test("bar") {
    assert(2 + 3 == 5)
    }
    }
    HelloTests.scala
    package tests

    class HelloTests extends munit.FunSuite {
    test("hello") {
    assert(2 + 2 == 4)
    }
    }
    scala-cli test . --test-only 'tests.only*' 
    # tests.only.BarTests:
    # + bar 0.045s

    Running a single test case by name

    note

    Test frameworks may have their own specific API for specifying the test cases to run aside from the test-only input.

    Munit

    To run a specific test case inside a test suite pass *test-name* as an argument to Scala CLI:

    MunitTests.scala
    //> using dep org.scalameta::munit::0.7.29
    package tests.only

    class Tests extends munit.FunSuite {
    test("bar") {
    assert(2 + 2 == 5)
    }
    test("foo") {
    assert(2 + 3 == 5)
    }
    test("foo-again") {
    assert(2 + 3 == 5)
    }
    }
    scala-cli test .  -- '*foo*'
    # tests.only.Tests:
    # + foo 0.045s
    # + foo-again 0.001s

    This will only run the test which contains the name foo, any other tests in your test suite will be skipped.

    Utest

    Unfortunately, the utest test framework doesn't support using glob pattern * to filter the test cases to run. In order to run a specific test case you will need to specify the exact name of the test you want to run.

    MyTests.scala
    //> using dep com.lihaoyi::utest::0.7.10

    import utest._

    object MyTests extends TestSuite {
    val tests = Tests {
    test("foo") {
    assert(2 + 2 == 4)
    println("Hello from " + "tests")
    }
    test("bar") {
    assert(2 + 2 == 4)
    println("Hello from " + "tests")
    }
    }
    }
    scala-cli test .  -- 'MyTests.foo'
    # -------------------------- Running Tests MyTests.foo --------------------------
    # Hello from tests
    # + MyTests.foo 8ms
    # Tests: 1, Passed: 1, Failed: 0

    This will run only the test case with the name MyTests.foo.

    - + \ No newline at end of file diff --git a/docs/cookbooks/vscode/index.html b/docs/cookbooks/vscode/index.html index f06fca68e9..908f968f8f 100644 --- a/docs/cookbooks/vscode/index.html +++ b/docs/cookbooks/vscode/index.html @@ -4,7 +4,7 @@ Setup a Scala CLI project in VSCode | Scala CLI - + @@ -12,7 +12,7 @@

    Setup a Scala CLI project in VSCode

    Scala CLI can generate the files that are necessary for providing IDE support in Visual Studio Code.

    For example, here is a simple project in scala-cli which contains only one main and one test class.

    HelloWorld.scala
    @main
    def hello() = println("Hello, world")
    MyTests.test.scala
    //> using dep org.scalameta::munit::1.0.0-M1

    class MyTests extends munit.FunSuite {
    test("test") {
    val x = 2
    assertEquals(x, 2)
    }
    }

    The following command generates configuration files for VSCode support:

    scala-cli setup-ide .

    There is also another way. The first time you run the run|compile|test commands, the configuration files for the VSCode will be also generated.

    scala-cli run .
    # "Hello, world"

    and then, we launch Visual Studio Code

    code .

    After starting metals, you will see the run/debug buttons in HelloWorld.scala and test/debug in MyTests.test.scala (assuming the following directory layout).

    layout

    Pressing the run button will run the Main.scala, the output will be visible in DebugConsole.

    And the similar effect after pressing the test button.

    - + \ No newline at end of file diff --git a/docs/getting_started/index.html b/docs/getting_started/index.html index 1265185851..e2da54a91d 100644 --- a/docs/getting_started/index.html +++ b/docs/getting_started/index.html @@ -4,13 +4,13 @@ Getting started | Scala CLI - +

    Getting started

    info

    This article requires knowledge of the Scala language (how to define a class or method) as well as Scala tooling (the REPL, and basics of dependency management and unit tests).

    In this article we show how to use Scala CLI to create a basic script, followed by small project with features like dependencies, tests, and IDE support. We aim to provide you with a knowledge of how to create and develop your first projects using Scala CLI.

    First, let's verify if Scala CLI is properly installed with a simple "hello world" test:

    echo 'println("Hello")' | scala-cli -
    Hello

    Running this command the first time may take a bit longer than usual and prints a fair number of logging output because Scala CLI needs to download all the artifacts it needs to compile and run the code.

    Scripting

    In that example we actually just created a Scala Script. To demonstrate this more fully, let's create a script in a hello.sc file that greets more properly:

    hello.sc
    def helloMessage(names: Seq[String]) = names match
    case Nil =>
    "Hello!"
    case names =>
    names.mkString("Hello: ", ", ", "!")

    println(helloMessage(args.toSeq))

    When that script is given no names, it prints "Hello!", and when it’s given one or more names it prints the string that's created in the second case statement. With Scala CLI we run the script like this:

    scala-cli hello.sc
    Hello

    To provide arguments to the script we add them after --:

    scala-cli hello.sc -- Jenny Jake
    Hello Jenny, Jake!

    You may wonder what kind of Scala version was used under the hood. The answer is the latest stable version which was tested in Scala CLI. If you want to specify the Scala version you can use -S or --scala option. More about setting Scala version in the dedicated cookbook.

    Scala CLI offers many more features dedicated for scripting, as described in the dedicated guide.

    Dependencies

    Now let's build something more serious. For this example, it's best to start with some prototyping inside the REPL. We can start a REPL session by running scala-cli repl. (If desired, you can also set the Scala version with -S or --scala.)

    note

    Scala CLI reuses most of its options across all of its commands.

    One of the main strengths of Scala is its ecosystem. Scala CLI is designed in a way to expose the Scala ecosystem to all usages of Scala, and running the REPL is no exception.

    To demonstrate this, let's start prototyping with os-lib — a Scala interface to common OS filesystem and subprocess methods. To experiment with os-lib in the REPL, we simply need to add the parameter --dep com.lihaoyi::os-lib:0.9.0, as shown here:

    scala-cli repl --dep com.lihaoyi::os-lib:0.9.0
    scala> os.pwd
    val res0: os.Path = ...

    scala> os.walk(os.pwd)
    val res1: IndexedSeq[os.Path] = ArraySeq(...)

    A project

    Now it's time to write some logic, based on the prototyping we just did. We'll create a filter function to display all files with the given filename extension in the current directory.

    For the consistency of our results, let's create a new directory and cd to it:

    mkdir scala-cli-getting-started
    cd scala-cli-getting-started

    Now we can write our logic in a file named files.scala:

    files.scala
    //> using dep com.lihaoyi::os-lib:0.9.0

    def filesByExtension(
    extension: String,
    dir: os.Path = os.pwd): Seq[os.Path] =
    os.walk(dir).filter { f =>
    f.last.endsWith(s".$extension") && os.isFile(f)
    }

    As you may have noticed, we specified a dependency within files.scala using the //> using dep com.lihaoyi::os-lib:0.9.0 syntax. With Scala CLI, you can provide configuration information with using directives — a dedicated syntax that can be embedded in any .scala file. For more details, see our dedicated guide for using directives.

    Now let's check if our code compiles. We do that by running:

    scala-cli compile .

    Notice that this time we didn’t provide a path to single files, but rather used a directory; in this case, the current directory. For project-like use cases, we recommend providing directories rather than individual files. For most cases, specifying the current directory (.) is a best choice.

    IDE support

    Some people are fine using the command line only, but most Scala developers use an IDE. To demonstrate this, let's open Metals with your favorite editor inside scala-cli-getting-started directory:

    At the present moment, support for IntelliJ is often problematic. But know that we are working on making it as rock-solid as Metals.

    Actually, in this case, we cheated a bit by running the compilation first. In order for Metals or IntelliJ to pick up a Scala CLI project, we need to generate a BSP connection detail file. Scala CLI generates these details by default every time compile, run, or test are run. We also expose a setup-ide command to manually control creation of the connection details file. For more information on this, see our IDE guide.

    Tests

    With our IDE in place, how can we test if our code works correctly? The best way is to create a unit test. The simplest way to add a test using scala-cli is by creating a file whose name ends with .test.scala, such as files.test.scala. (There are also other ways to mark source code files as containing a test, as described in tests guide.)

    We also need to add a test framework. Scala CLI support most popular test frameworks, and for this guide we will stick with munit. To add a test framework, we just need an ordinary dependency, and once again we'll add that with the using directive:

    files.test.scala
    //> using dep org.scalameta::munit:1.0.0-M1

    class TestSuite extends munit.FunSuite {
    test("hello") {
    val expected = Set("files.scala", "files.test.scala")
    val obtained = filesByExtension("scala").map(_.last).toSet
    assertEquals(obtained, expected)
    }
    }

    Now we can run our tests at the command line:

    scala-cli test .
    Compiling project (test, Scala 3.0.2, JVM)
    Compiled project (test, Scala 3.0.2, JVM)
    TestSuite:
    + hello 0.058s

    or directly within Metals:

    A project, vol 2

    With our code ready and tested, now it's time to turn it into a command-line tool that counts files by their extension. For this we can write a simple script. A great feature of Scala CLI is that scripts and Scala sources can be mixed:

    countByExtension.sc
    val (ext, directory) = args.toSeq match
    case Seq(ext) => (ext, os.pwd)
    case Seq(ext, directory) => (ext, os.Path(directory))
    case other =>
    println(s"Expected: `extension [directory]` but got: `${other.mkString(" ")}`")
    sys.exit(1)

    val files = filesByExtension(ext, directory)
    files.map(_.relativeTo(directory)).foreach(println)

    As you probably noticed, we are using os-lib in our script without any using directive, How is that possible? The way it works is that configuration details provided by using directives are global, and apply to all files. Since files.scala and countByExtension.sc are compiled together, the using directives in files.scala are used when compiling both files. (Note that defining a library dependency in more than one file is an anti-pattern.)

    Now let's run our code, looking for all files that end with the .scala extension:

    scala-cli . -- scala
    files.scala
    .scala-build/project_940fb43dce/src_generated/main/countByExtension.scala
    files.test.scala

    Seeing that output, you may wonder, why do we have an additional .scala file under the .scala-build dir? The way this works is that under the hood, Scala CLI sometimes needs to preprocess source code files — such as scripts. So these preprocessed files are created under the .scala-build directory, and then compiled from there.

    Packaging

    We could stop here and call Scala CLI on our set of sources every time. Scala CLI uses caches aggressively, so rollup runs are reasonably fast — less than 1,500 milliseconds on tested machine — but sometimes this isn't fast enough, or shipping sources and compiling them may be not convenient.

    For these use cases, Scala CLI offers means to package your project. For example, we can run this command to generate a thin, executable jar file, with the compiled code inside:

    scala-cli --power package . -o countByExtension

    The default binary name is app, so in this example we provide the -o flag to make the name of the binary countByExtension. Now we can run our project like this:

    ./countByExtension scala

    This time it only took 350 milliseconds, so this is a big improvement. When you create a binary file (a runnable jar) like this, it's self-contained, and can be shipped to your colleagues or deployed.

    We can reduce the startup time even further using Scala Native, or by packaging our application to other formats like Docker container, assembly, or even OS-specific packages (.dep, .pkg, etc.). See those resources for more information.

    Summary

    With this guide we've only scratched the surface of what Scala CLI can do. For many more details, we've prepared a set of cookbooks that showcase solutions to common problems, as well as a detailed set of guides for our commands.

    We also have a dedicated room on Scala discord where you can ask for help or discuss anything that's related to Scala CLI. For more in-depth discussions, we're using Github discussions in our repo; this is the best place to suggest a new feature or any improvements.

    - + \ No newline at end of file diff --git a/docs/guides/configuration/index.html b/docs/guides/configuration/index.html index 6264f49c57..96759b6905 100644 --- a/docs/guides/configuration/index.html +++ b/docs/guides/configuration/index.html @@ -4,7 +4,7 @@ Configuration | Scala CLI - + @@ -14,7 +14,7 @@ This is achieved by specifying using directives inside comments at the top of a .scala file, before any package or import statement:

    //> using scala 2.13
    //> using platform scala-js
    //> using options -Xasync

    // package and import statements follow here ...

    The reference documentation lists all available using directives.

    Also, there are some directives which only target tests, like using test.dep. Those can be useful when defining configuration specific to your test runs.

    //> using test.dep com.lihaoyi::utest:0.7.10

    More details can be found in the using directives guide.

    Special imports

    Dependencies can be added right from .scala and .sc files with using directives:

    //> using dep com.lihaoyi::upickle:1.4.0
    //> using dep com.lihaoyi::pprint:0.6.6
    import ujson._

    Both import $ivy and import $dep are not supported.

    - + \ No newline at end of file diff --git a/docs/guides/dependencies/index.html b/docs/guides/dependencies/index.html index b069b02b0f..4bf5c3d79b 100644 --- a/docs/guides/dependencies/index.html +++ b/docs/guides/dependencies/index.html @@ -4,7 +4,7 @@ Managing dependencies | Scala CLI - + @@ -22,7 +22,7 @@ via using directives. However, the --dependency CLI option takes precedence over using directives, so it can be used to override a using directive, such as when you want to work with a different dependency version.

    You can also add repositories on the command-line, via --repository or //> using repos

    scala-cli compile Sample.sc \
    --dependency com.pany::util:33.1.0 --repo https://artifacts.pany.com/maven

    Lastly, you can also add simple JAR files as dependencies with --jar:

    scala-cli compile Sample.sc --jar /path/to/library.jar

    Adding local JARs as dependencies

    You can pass local JARs from the command line with the --extra-jar option:

    scala-cli compile Sample.sc \
    --extra-jar "./path/to/custom.jar"

    Local sources JARs can also be passed in a similar manner:

    scala-cli compile Sample.sc \
    --extra-source-jar "./path/to/custom-sources.jar"

    Both can be handled with the appropriate using directives, too:

    //> using jar "./path/to/custom.jar"
    //> using sourceJar "./path/to/custom-sources.jar"
    caution

    Local JARs with the *-sources.jar suffix are assumed to be sources JARs and are treated as such.

    - + \ No newline at end of file diff --git a/docs/guides/ide/index.html b/docs/guides/ide/index.html index ea4d5c67d6..e1a7f445e5 100644 --- a/docs/guides/ide/index.html +++ b/docs/guides/ide/index.html @@ -4,7 +4,7 @@ IDE support | Scala CLI - + @@ -36,7 +36,7 @@ without the need to jump into the command line whenever you create a new file.

    Remote and virtual inputs

    Do note that IDEs do not yet support working with Scala CLI's remote and virtual inputs. That includes:

    Beyond that, IDE support for some non-standard (like .c and .h resources used with Scala Native) and experimental inputs (like i.e. .md sources) may not yet be on par with on-disk Scala and Java source files.

    - + \ No newline at end of file diff --git a/docs/guides/internals/index.html b/docs/guides/internals/index.html index 01742702cb..fd1efb0ff4 100644 --- a/docs/guides/internals/index.html +++ b/docs/guides/internals/index.html @@ -4,7 +4,7 @@ Internals | Scala CLI - + @@ -28,7 +28,7 @@ of the runner module starts your main class, catches any exceptions it might throw, and prints it.

    Logging

    To get a glimpse at what Scala CLI is doing, increase its verbosity with -v. The -v option can be specified up to 3 times, which increases its verbosity level.

    Using this option can be a good way to learn how Scala CLI works, though it's mostly meant to help debug issues. When reporting bugs, increasing the verbosity to its maximum level can be helpful.

    Here's some example output for the first verbosity level:

    $ scala-cli . -v
    Running /Users/alexandre/Library/Caches/Coursier/jvm/adopt@1.11.0-7/Contents/Home/bin/java -cp /Users/alexandre/projects/scala-cli/test/.scala/project_940fb43dce/classes/main:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.2/scala3-library_3-3.0.2.jar:/Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7/org.virtuslab.scala-cli/runner_3/0.0.5+43-g60eae701-SNAPSHOT/jars/runner_3.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.6/scala-library-2.13.6.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/oss.sonatype.org/content/repositories/snapshots/org/virtuslab/pretty-stacktraces_3/0.0.0%2B27-b9d69198-SNAPSHOT/pretty-stacktraces_3-0.0.0%2B27-b9d69198-SNAPSHOT.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-tasty-inspector_3/3.0.0/scala3-tasty-inspector_3-3.0.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.0.0/scala3-compiler_3-3.0.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-interfaces/3.0.0/scala3-interfaces-3.0.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/tasty-core_3/3.0.0/tasty-core_3-3.0.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-asm/9.1.0-scala-1/scala-asm-9.1.0-scala-1.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.3.5/compiler-interface-1.3.5.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-reader/3.19.0/jline-reader-3.19.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal/3.19.0/jline-terminal-3.19.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal-jna/3.19.0/jline-terminal-jna-3.19.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.7.0/protobuf-java-3.7.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.3.0/util-interface-1.3.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.3.1/jna-5.3.1.jar:/Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7/org.virtuslab.scala-cli/stubs/0.0.5+43-g60eae701-SNAPSHOT/jars/stubs.jar scala.cli.runner.Runner test_sc
    Hello

    Next, this output shows how much more detail is available when -v is specified twice:

    $ scala-cli . -v -v
    Fetching List(ch.epfl.scala:bloop-frontend_2.12:1.4.8-124-49a6348a)
    Found 127 artifacts:
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/bloop-frontend_2.12/1.4.8-124-49a6348a/bloop-frontend_2.12-1.4.8-124-49a6348a.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.13/scala-library-2.12.13.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/sockets/1.4.8-124-49a6348a/sockets-1.4.8-124-49a6348a.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/bloop-shared_2.12/1.4.8-124-49a6348a/bloop-shared_2.12-1.4.8-124-49a6348a.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/bloop-backend_2.12/1.4.8-124-49a6348a/bloop-backend_2.12-1.4.8-124-49a6348a.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/bloop-config_2.12/1.4.8-124-49a6348a/bloop-config_2.12-1.4.8-124-49a6348a.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalaz/scalaz-core_2.12/7.2.20/scalaz-core_2.12-7.2.20.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/monix/monix_2.12/2.3.3/monix_2.12-2.3.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/alexarchambault/case-app_2.12/2.0.6/case-app_2.12-2.0.6.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/scala-debug-adapter_2.12/1.1.3/scala-debug-adapter_2.12-1.1.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.8.0/jna-5.8.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna-platform/5.8.0/jna-platform-5.8.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/bsp4s_2.12/2.0.0-M13/bsp4s_2.12-2.0.0-M13.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/zinc_2.12/1.3.0-M4%2B46-edbe573e/zinc_2.12-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/jpountz/lz4/lz4/1.3.0/lz4-1.3.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/soc/directories/10/directories-10.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/test-interface/1.0/test-interface-1.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/test-agent/1.4.4/test-agent-1.4.4.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/googlecode/java-diff-utils/diffutils/1.3.0/diffutils-1.3.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/pprint_2.12/0.5.3/pprint_2.12-0.5.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/com-microsoft-java-debug-core/0.21.0%2B1-7f1080f1/com-microsoft-java-debug-core-0.21.0%2B1-7f1080f1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/nailgun-server/ee3c4343/nailgun-server-ee3c4343.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalaz/scalaz-concurrent_2.12/7.2.20/scalaz-concurrent_2.12-7.2.20.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier_2.12/2.0.16/coursier_2.12-2.0.16.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier-cache_2.12/2.0.16/coursier-cache_2.12-2.0.16.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/librarymanagement-ivy_2.12/1.0.0/librarymanagement-ivy_2.12-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.1.4/sourcecode_2.12-0.1.4.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/directory-watcher/0.8.0%2B6-f651bd93/directory-watcher-0.8.0%2B6-f651bd93.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/zeroturnaround/zt-zip/1.13/zt-zip-1.13.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/zipkin/brave/brave/5.6.1/brave-5.6.1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/zipkin/reporter2/zipkin-sender-urlconnection/2.7.15/zipkin-sender-urlconnection-2.7.15.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm/9.2/asm-9.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-util/9.2/asm-util-9.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/plokhotnyuk/jsoniter-scala/jsoniter-scala-core_2.12/2.4.0/jsoniter-scala-core_2.12-2.4.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/monix/monix-types_2.12/2.3.3/monix-types_2.12-2.3.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/monix/monix-execution_2.12/2.3.3/monix-execution_2.12-2.3.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/monix/monix-eval_2.12/2.3.3/monix-eval_2.12-2.3.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/monix/monix-reactive_2.12/2.3.3/monix-reactive_2.12-2.3.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/alexarchambault/case-app-annotations_2.12/2.0.6/case-app-annotations_2.12-2.0.6.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/alexarchambault/case-app-util_2.12/2.0.6/case-app-util_2.12-2.0.6.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-core_2.12/0.9.3/circe-core_2.12-0.9.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-derivation_2.12/0.9.0-M4/circe-derivation_2.12-0.9.0-M4.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalameta/lsp4s_2.12/0.2.0/lsp4s_2.12-0.2.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/zinc-core_2.12/1.3.0-M4%2B46-edbe573e/zinc-core_2.12-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/zinc-persist_2.12/1.3.0-M4%2B46-edbe573e/zinc-persist_2.12-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/zinc-compile-core_2.12/1.3.0-M4%2B46-edbe573e/zinc-compile-core_2.12-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/zinc-classfile_2.12/1.3.0-M4%2B46-edbe573e/zinc-classfile_2.12-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.7.0/protobuf-java-3.7.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/fansi_2.12/0.2.5/fansi_2.12-0.2.5.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.6/commons-lang3-3.6.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/code/gson/gson/2.7/gson-2.7.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/reactivex/rxjava2/rxjava/2.1.1/rxjava-2.1.1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/reactivestreams/reactive-streams/1.0.0/reactive-streams-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/commons-io/commons-io/2.5/commons-io-2.5.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.26/slf4j-api-1.7.26.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalaz/scalaz-effect_2.12/7.2.20/scalaz-effect_2.12-7.2.20.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier-core_2.12/2.0.16/coursier-core_2.12-2.0.16.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/alexarchambault/argonaut-shapeless_6.2_2.12/1.2.0/argonaut-shapeless_6.2_2.12-1.2.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier-util_2.12/2.0.16/coursier-util_2.12-2.0.16.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/alexarchambault/windows-ansi/windows-ansi/0.0.3/windows-ansi-0.0.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/librarymanagement-core_2.12/1.0.0/librarymanagement-core_2.12-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/sjson-new-core_2.12/0.8.2/sjson-new-core_2.12-0.8.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/ivy/ivy/2.3.0-sbt-a3314352b638afbf0dca19f127e8263ed6f898bd/ivy-2.3.0-sbt-a3314352b638afbf0dca19f127e8263ed6f898bd.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/zipkin/zipkin2/zipkin/2.12.1/zipkin-2.12.1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/zipkin/reporter2/zipkin-reporter/2.7.15/zipkin-reporter-2.7.15.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-tree/9.2/asm-tree-9.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-analysis/9.2/asm-analysis-9.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jctools/jctools-core/2.0.1/jctools-core-2.0.1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/chuusai/shapeless_2.12/2.3.3/shapeless_2.12-2.3.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-numbers_2.12/0.9.3/circe-numbers_2.12-0.9.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-core_2.12/1.1.0/cats-core_2.12-1.1.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalameta/jsonrpc_2.12/0.2.0/jsonrpc_2.12-0.2.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/beachape/enumeratum_2.12/1.5.13/enumeratum_2.12-1.5.13.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/beachape/enumeratum-circe_2.12/1.5.17/enumeratum-circe_2.12-1.5.17.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/zinc-apiinfo_2.12/1.3.0-M4%2B46-edbe573e/zinc-apiinfo_2.12-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/zinc-classpath_2.12/1.3.0-M4%2B46-edbe573e/zinc-classpath_2.12-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/compiler-interface/1.3.0-M4%2B46-edbe573e/compiler-interface-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/thesamet/scalapb/scalapb-runtime_2.12/0.8.0-RC1/scalapb-runtime_2.12-0.8.0-RC1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/io_2.12/1.2.0/io_2.12-1.2.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-logging_2.12/1.2.2/util-logging_2.12-1.2.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-relation_2.12/1.2.2/util-relation_2.12-1.2.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/sbinary_2.12/0.5.0/sbinary_2.12-0.5.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/launcher-interface/1.0.0/launcher-interface-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.12/1.0.5/scala-parser-combinators_2.12-1.0.5.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-control_2.12/1.2.2/util-control_2.12-1.2.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/alexarchambault/concurrent-reference-hash-map/1.0.0/concurrent-reference-hash-map-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.12/1.3.0/scala-xml_2.12-1.3.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/argonaut/argonaut_2.12/6.2.5/argonaut_2.12-6.2.5.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.12/2.2.0/scala-collection-compat_2.12-2.2.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.18/jansi-1.18.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.11/scala-compiler-2.12.11.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/jcraft/jsch/0.1.46/jsch-0.1.46.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.11/scala-reflect-2.12.11.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/gigahorse-okhttp_2.12/0.3.0/gigahorse-okhttp_2.12-0.3.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/squareup/okhttp3/okhttp-urlconnection/3.7.0/okhttp-urlconnection-3.7.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-position_2.12/1.0.0/util-position_2.12-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-cache_2.12/1.0.0/util-cache_2.12-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/macro-compat_2.12/1.1.1/macro-compat_2.12-1.1.1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-macros_2.12/1.1.0/cats-macros_2.12-1.1.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-kernel_2.12/1.1.0/cats-kernel_2.12-1.1.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/machinist_2.12/0.6.2/machinist_2.12-0.6.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/outr/scribe_2.12/2.5.0/scribe_2.12-2.5.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-parser_2.12/0.9.3/circe-parser_2.12-0.9.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/beachape/enumeratum-macros_2.12/1.5.9/enumeratum-macros_2.12-1.5.9.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/compiler-bridge_2.12/1.3.0-M4%2B46-edbe573e/compiler-bridge_2.12-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.2.2/util-interface-1.2.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/thesamet/scalapb/lenses_2.12/0.8.0-RC1/lenses_2.12-0.8.0-RC1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/fastparse_2.12/1.0.0/fastparse_2.12-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/swoval/apple-file-events/1.3.2/apple-file-events-1.3.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/jline/jline/2.14.4/jline-2.14.4.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/logging/log4j/log4j-api/2.8.1/log4j-api-2.8.1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core/2.8.1/log4j-core-2.8.1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lmax/disruptor/3.3.6/disruptor-3.3.6.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/sjson-new-scalajson_2.12/0.8.2/sjson-new-scalajson_2.12-0.8.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/gigahorse-core_2.12/0.3.0/gigahorse-core_2.12-0.3.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.7.0/okhttp-3.7.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/sjson-new-murmurhash_2.12/0.8.0/sjson-new-murmurhash_2.12-0.8.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/outr/scribe-macros_2.12/2.5.0/scribe-macros_2.12-2.5.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/outr/perfolation_2.12/1.0.2/perfolation_2.12-1.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-jawn_2.12/0.9.3/circe-jawn_2.12-0.9.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/fastparse-utils_2.12/1.0.0/fastparse-utils_2.12-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/shaded-scalajson_2.12/1.0.0-M4/shaded-scalajson_2.12-1.0.0-M4.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/spire-math/jawn-parser_2.12/0.11.1/jawn-parser_2.12-0.11.1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/typesafe/ssl-config-core_2.12/0.2.2/ssl-config-core_2.12-0.2.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/squareup/okio/okio/1.12.0/okio-1.12.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/outr/perfolation-macros_2.12/1.0.2/perfolation-macros_2.12-1.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/typesafe/config/1.2.0/config-1.2.0.jar

    Fetching List(org.scala-lang::scala3-compiler:3.0.2), adding List(https://oss.sonatype.org/content/repositories/snapshots, ivy:file:///Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7//[defaultPattern])
    Found 13 artifacts:
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.0.2/scala3-compiler_3-3.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-interfaces/3.0.2/scala3-interfaces-3.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.2/scala3-library_3-3.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/tasty-core_3/3.0.2/tasty-core_3-3.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-asm/9.1.0-scala-1/scala-asm-9.1.0-scala-1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.3.5/compiler-interface-1.3.5.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-reader/3.19.0/jline-reader-3.19.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal/3.19.0/jline-terminal-3.19.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal-jna/3.19.0/jline-terminal-jna-3.19.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.6/scala-library-2.13.6.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.7.0/protobuf-java-3.7.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.3.0/util-interface-1.3.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.3.1/jna-5.3.1.jar

    Fetching List(org.scala-lang::scala3-library::3.0.2, org.virtuslab.scala-cli::runner:0.0.5+43-g60eae701-SNAPSHOT), adding List(https://oss.sonatype.org/content/repositories/snapshots, ivy:file:///Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7//[defaultPattern])
    Fetching List(org.virtuslab.scala-cli:stubs:0.0.5+43-g60eae701-SNAPSHOT), adding List(https://oss.sonatype.org/content/repositories/snapshots, ivy:file:///Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7//[defaultPattern])
    Found 1 artifacts:
    /Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7/org.virtuslab.scala-cli/stubs/0.0.5+43-g60eae701-SNAPSHOT/jars/stubs.jar

    Writing bloop project in /Users/alexandre/projects/scala-cli/test/.scala/.bloop/project_940fb43dce.json
    Listing BSP build targets
    Compiling project_940fb43dce with Bloop
    Received onBuildTaskStart from bloop: TaskStartParams [
    taskId = TaskId [
    id = "1"
    parents = null
    ]
    eventTime = 1634309123019
    message = "Compiling project_940fb43dce (1 Scala source)"
    dataKind = "compile-task"
    data = {"target":{"uri":"file:/Users/alexandre/projects/scala-cli/test/.scala/?id=project_940fb43dce"}}
    ]
    Compiling project (Scala 3.0.2, JVM)
    Received onBuildTaskFinish from bloop: TaskFinishParams [
    taskId = TaskId [
    id = "1"
    parents = null
    ]
    eventTime = 1634309127394
    message = "Compiled 'project_940fb43dce'"
    status = OK
    dataKind = "compile-report"
    data = {"target":{"uri":"file:/Users/alexandre/projects/scala-cli/test/.scala/?id=project_940fb43dce"},"originId":null,"errors":0,"warnings":0,"time":null,"isNoOp":false,"isLastCycle":true,"clientDir":"file:///Users/alexandre/projects/scala-cli/test/.scala/project_940fb43dce/classes/main/","analysisOut":"file:///Users/alexandre/projects/scala-cli/test/.scala/.bloop/project_940fb43dce/project_940fb43dce-analysis.bin"}
    ]
    Compiled project (Scala 3.0.2, JVM)
    Compilation succeeded
    Post-processing class files of pre-processed sources
    Overwriting .scala/project_940fb43dce/classes/main/test$.class
    Overwriting .scala/project_940fb43dce/classes/main/test.class
    Overwriting .scala/project_940fb43dce/classes/main/test_sc$.class
    Overwriting .scala/project_940fb43dce/classes/main/test_sc.class
    Moving semantic DBs around
    Reading TASTy file /Users/alexandre/projects/scala-cli/test/.scala/project_940fb43dce/classes/main/test.tasty
    Parsed TASTy file /Users/alexandre/projects/scala-cli/test/.scala/project_940fb43dce/classes/main/test.tasty
    Overwriting .scala/project_940fb43dce/classes/main/test.tasty
    Reading TASTy file /Users/alexandre/projects/scala-cli/test/.scala/project_940fb43dce/classes/main/test_sc.tasty
    Parsed TASTy file /Users/alexandre/projects/scala-cli/test/.scala/project_940fb43dce/classes/main/test_sc.tasty
    Overwriting .scala/project_940fb43dce/classes/main/test_sc.tasty
    Fetching List(org.scala-lang::scala3-compiler:3.0.2), adding List(https://oss.sonatype.org/content/repositories/snapshots, ivy:file:///Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7//[defaultPattern])
    Found 13 artifacts:
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.0.2/scala3-compiler_3-3.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-interfaces/3.0.2/scala3-interfaces-3.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.2/scala3-library_3-3.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/tasty-core_3/3.0.2/tasty-core_3-3.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-asm/9.1.0-scala-1/scala-asm-9.1.0-scala-1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.3.5/compiler-interface-1.3.5.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-reader/3.19.0/jline-reader-3.19.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal/3.19.0/jline-terminal-3.19.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal-jna/3.19.0/jline-terminal-jna-3.19.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.6/scala-library-2.13.6.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.7.0/protobuf-java-3.7.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.3.0/util-interface-1.3.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.3.1/jna-5.3.1.jar

    Fetching List(org.scala-lang::scala3-library::3.0.2, org.virtuslab.scala-cli::runner:0.0.5+43-g60eae701-SNAPSHOT), adding List(https://oss.sonatype.org/content/repositories/snapshots, ivy:file:///Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7//[defaultPattern])
    Fetching List(org.virtuslab.scala-cli:stubs:0.0.5+43-g60eae701-SNAPSHOT), adding List(https://oss.sonatype.org/content/repositories/snapshots, ivy:file:///Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7//[defaultPattern])
    Found 1 artifacts:
    /Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7/org.virtuslab.scala-cli/stubs/0.0.5+43-g60eae701-SNAPSHOT/jars/stubs.jar

    Writing bloop project in /Users/alexandre/projects/scala-cli/test/.scala/.bloop/project_f643cb0bc2-test.json
    Listing BSP build targets
    Compiling project_f643cb0bc2-test with Bloop
    Compilation succeeded
    Post-processing class files of pre-processed sources
    Moving semantic DBs around
    Running
    /Users/alexandre/Library/Caches/Coursier/jvm/adopt@1.11.0-7/Contents/Home/bin/java
    -cp
    /Users/alexandre/projects/scala-cli/test/.scala/project_940fb43dce/classes/main:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.2/scala3-library_3-3.0.2.jar:/Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7/org.virtuslab.scala-cli/runner_3/0.0.5+43-g60eae701-SNAPSHOT/jars/runner_3.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.6/scala-library-2.13.6.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/oss.sonatype.org/content/repositories/snapshots/org/virtuslab/pretty-stacktraces_3/0.0.0%2B27-b9d69198-SNAPSHOT/pretty-stacktraces_3-0.0.0%2B27-b9d69198-SNAPSHOT.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-tasty-inspector_3/3.0.0/scala3-tasty-inspector_3-3.0.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.0.0/scala3-compiler_3-3.0.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-interfaces/3.0.0/scala3-interfaces-3.0.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/tasty-core_3/3.0.0/tasty-core_3-3.0.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-asm/9.1.0-scala-1/scala-asm-9.1.0-scala-1.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.3.5/compiler-interface-1.3.5.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-reader/3.19.0/jline-reader-3.19.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal/3.19.0/jline-terminal-3.19.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal-jna/3.19.0/jline-terminal-jna-3.19.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.7.0/protobuf-java-3.7.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.3.0/util-interface-1.3.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.3.1/jna-5.3.1.jar:/Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7/org.virtuslab.scala-cli/stubs/0.0.5+43-g60eae701-SNAPSHOT/jars/stubs.jar
    scala.cli.runner.Runner
    test_sc

    execve available
    Hello

    Finally, this example shows the detail that's available when -v is specified three times:

    $ scala-cli . -v -v -v
    Attempting a connection to bloop server 127.0.0.1:8212 ...
    No bloop daemon found on 127.0.0.1:8212
    Starting bloop server
    Fetching List(ch.epfl.scala:bloop-frontend_2.12:1.4.8-124-49a6348a)
    Found 127 artifacts:
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/bloop-frontend_2.12/1.4.8-124-49a6348a/bloop-frontend_2.12-1.4.8-124-49a6348a.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.13/scala-library-2.12.13.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/sockets/1.4.8-124-49a6348a/sockets-1.4.8-124-49a6348a.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/bloop-shared_2.12/1.4.8-124-49a6348a/bloop-shared_2.12-1.4.8-124-49a6348a.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/bloop-backend_2.12/1.4.8-124-49a6348a/bloop-backend_2.12-1.4.8-124-49a6348a.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/bloop-config_2.12/1.4.8-124-49a6348a/bloop-config_2.12-1.4.8-124-49a6348a.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalaz/scalaz-core_2.12/7.2.20/scalaz-core_2.12-7.2.20.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/monix/monix_2.12/2.3.3/monix_2.12-2.3.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/alexarchambault/case-app_2.12/2.0.6/case-app_2.12-2.0.6.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/scala-debug-adapter_2.12/1.1.3/scala-debug-adapter_2.12-1.1.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.8.0/jna-5.8.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna-platform/5.8.0/jna-platform-5.8.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/bsp4s_2.12/2.0.0-M13/bsp4s_2.12-2.0.0-M13.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/zinc_2.12/1.3.0-M4%2B46-edbe573e/zinc_2.12-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/jpountz/lz4/lz4/1.3.0/lz4-1.3.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/soc/directories/10/directories-10.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/test-interface/1.0/test-interface-1.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/test-agent/1.4.4/test-agent-1.4.4.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/googlecode/java-diff-utils/diffutils/1.3.0/diffutils-1.3.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/pprint_2.12/0.5.3/pprint_2.12-0.5.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/com-microsoft-java-debug-core/0.21.0%2B1-7f1080f1/com-microsoft-java-debug-core-0.21.0%2B1-7f1080f1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/nailgun-server/ee3c4343/nailgun-server-ee3c4343.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalaz/scalaz-concurrent_2.12/7.2.20/scalaz-concurrent_2.12-7.2.20.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier_2.12/2.0.16/coursier_2.12-2.0.16.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier-cache_2.12/2.0.16/coursier-cache_2.12-2.0.16.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/librarymanagement-ivy_2.12/1.0.0/librarymanagement-ivy_2.12-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.1.4/sourcecode_2.12-0.1.4.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/directory-watcher/0.8.0%2B6-f651bd93/directory-watcher-0.8.0%2B6-f651bd93.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/zeroturnaround/zt-zip/1.13/zt-zip-1.13.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/zipkin/brave/brave/5.6.1/brave-5.6.1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/zipkin/reporter2/zipkin-sender-urlconnection/2.7.15/zipkin-sender-urlconnection-2.7.15.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm/9.2/asm-9.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-util/9.2/asm-util-9.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/plokhotnyuk/jsoniter-scala/jsoniter-scala-core_2.12/2.4.0/jsoniter-scala-core_2.12-2.4.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/monix/monix-types_2.12/2.3.3/monix-types_2.12-2.3.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/monix/monix-execution_2.12/2.3.3/monix-execution_2.12-2.3.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/monix/monix-eval_2.12/2.3.3/monix-eval_2.12-2.3.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/monix/monix-reactive_2.12/2.3.3/monix-reactive_2.12-2.3.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/alexarchambault/case-app-annotations_2.12/2.0.6/case-app-annotations_2.12-2.0.6.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/alexarchambault/case-app-util_2.12/2.0.6/case-app-util_2.12-2.0.6.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-core_2.12/0.9.3/circe-core_2.12-0.9.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-derivation_2.12/0.9.0-M4/circe-derivation_2.12-0.9.0-M4.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalameta/lsp4s_2.12/0.2.0/lsp4s_2.12-0.2.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/zinc-core_2.12/1.3.0-M4%2B46-edbe573e/zinc-core_2.12-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/zinc-persist_2.12/1.3.0-M4%2B46-edbe573e/zinc-persist_2.12-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/zinc-compile-core_2.12/1.3.0-M4%2B46-edbe573e/zinc-compile-core_2.12-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/zinc-classfile_2.12/1.3.0-M4%2B46-edbe573e/zinc-classfile_2.12-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.7.0/protobuf-java-3.7.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/fansi_2.12/0.2.5/fansi_2.12-0.2.5.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.6/commons-lang3-3.6.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/code/gson/gson/2.7/gson-2.7.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/reactivex/rxjava2/rxjava/2.1.1/rxjava-2.1.1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/reactivestreams/reactive-streams/1.0.0/reactive-streams-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/commons-io/commons-io/2.5/commons-io-2.5.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.26/slf4j-api-1.7.26.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalaz/scalaz-effect_2.12/7.2.20/scalaz-effect_2.12-7.2.20.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier-core_2.12/2.0.16/coursier-core_2.12-2.0.16.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/alexarchambault/argonaut-shapeless_6.2_2.12/1.2.0/argonaut-shapeless_6.2_2.12-1.2.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier-util_2.12/2.0.16/coursier-util_2.12-2.0.16.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/alexarchambault/windows-ansi/windows-ansi/0.0.3/windows-ansi-0.0.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/librarymanagement-core_2.12/1.0.0/librarymanagement-core_2.12-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/sjson-new-core_2.12/0.8.2/sjson-new-core_2.12-0.8.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/ivy/ivy/2.3.0-sbt-a3314352b638afbf0dca19f127e8263ed6f898bd/ivy-2.3.0-sbt-a3314352b638afbf0dca19f127e8263ed6f898bd.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/zipkin/zipkin2/zipkin/2.12.1/zipkin-2.12.1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/zipkin/reporter2/zipkin-reporter/2.7.15/zipkin-reporter-2.7.15.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-tree/9.2/asm-tree-9.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-analysis/9.2/asm-analysis-9.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jctools/jctools-core/2.0.1/jctools-core-2.0.1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/chuusai/shapeless_2.12/2.3.3/shapeless_2.12-2.3.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-numbers_2.12/0.9.3/circe-numbers_2.12-0.9.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-core_2.12/1.1.0/cats-core_2.12-1.1.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalameta/jsonrpc_2.12/0.2.0/jsonrpc_2.12-0.2.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/beachape/enumeratum_2.12/1.5.13/enumeratum_2.12-1.5.13.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/beachape/enumeratum-circe_2.12/1.5.17/enumeratum-circe_2.12-1.5.17.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/zinc-apiinfo_2.12/1.3.0-M4%2B46-edbe573e/zinc-apiinfo_2.12-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/zinc-classpath_2.12/1.3.0-M4%2B46-edbe573e/zinc-classpath_2.12-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/compiler-interface/1.3.0-M4%2B46-edbe573e/compiler-interface-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/thesamet/scalapb/scalapb-runtime_2.12/0.8.0-RC1/scalapb-runtime_2.12-0.8.0-RC1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/io_2.12/1.2.0/io_2.12-1.2.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-logging_2.12/1.2.2/util-logging_2.12-1.2.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-relation_2.12/1.2.2/util-relation_2.12-1.2.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/sbinary_2.12/0.5.0/sbinary_2.12-0.5.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/launcher-interface/1.0.0/launcher-interface-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.12/1.0.5/scala-parser-combinators_2.12-1.0.5.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-control_2.12/1.2.2/util-control_2.12-1.2.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/alexarchambault/concurrent-reference-hash-map/1.0.0/concurrent-reference-hash-map-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.12/1.3.0/scala-xml_2.12-1.3.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/argonaut/argonaut_2.12/6.2.5/argonaut_2.12-6.2.5.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.12/2.2.0/scala-collection-compat_2.12-2.2.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.18/jansi-1.18.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.11/scala-compiler-2.12.11.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/jcraft/jsch/0.1.46/jsch-0.1.46.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.11/scala-reflect-2.12.11.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/gigahorse-okhttp_2.12/0.3.0/gigahorse-okhttp_2.12-0.3.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/squareup/okhttp3/okhttp-urlconnection/3.7.0/okhttp-urlconnection-3.7.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-position_2.12/1.0.0/util-position_2.12-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-cache_2.12/1.0.0/util-cache_2.12-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/macro-compat_2.12/1.1.1/macro-compat_2.12-1.1.1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-macros_2.12/1.1.0/cats-macros_2.12-1.1.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-kernel_2.12/1.1.0/cats-kernel_2.12-1.1.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/machinist_2.12/0.6.2/machinist_2.12-0.6.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/outr/scribe_2.12/2.5.0/scribe_2.12-2.5.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-parser_2.12/0.9.3/circe-parser_2.12-0.9.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/beachape/enumeratum-macros_2.12/1.5.9/enumeratum-macros_2.12-1.5.9.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/compiler-bridge_2.12/1.3.0-M4%2B46-edbe573e/compiler-bridge_2.12-1.3.0-M4%2B46-edbe573e.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.2.2/util-interface-1.2.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/thesamet/scalapb/lenses_2.12/0.8.0-RC1/lenses_2.12-0.8.0-RC1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/fastparse_2.12/1.0.0/fastparse_2.12-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/swoval/apple-file-events/1.3.2/apple-file-events-1.3.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/jline/jline/2.14.4/jline-2.14.4.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/logging/log4j/log4j-api/2.8.1/log4j-api-2.8.1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core/2.8.1/log4j-core-2.8.1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lmax/disruptor/3.3.6/disruptor-3.3.6.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/sjson-new-scalajson_2.12/0.8.2/sjson-new-scalajson_2.12-0.8.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/gigahorse-core_2.12/0.3.0/gigahorse-core_2.12-0.3.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.7.0/okhttp-3.7.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/sjson-new-murmurhash_2.12/0.8.0/sjson-new-murmurhash_2.12-0.8.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/outr/scribe-macros_2.12/2.5.0/scribe-macros_2.12-2.5.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/outr/perfolation_2.12/1.0.2/perfolation_2.12-1.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-jawn_2.12/0.9.3/circe-jawn_2.12-0.9.3.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/fastparse-utils_2.12/1.0.0/fastparse-utils_2.12-1.0.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/shaded-scalajson_2.12/1.0.0-M4/shaded-scalajson_2.12-1.0.0-M4.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/spire-math/jawn-parser_2.12/0.11.1/jawn-parser_2.12-0.11.1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/typesafe/ssl-config-core_2.12/0.2.2/ssl-config-core_2.12-0.2.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/squareup/okio/okio/1.12.0/okio-1.12.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/outr/perfolation-macros_2.12/1.0.2/perfolation-macros_2.12-1.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/typesafe/config/1.2.0/config-1.2.0.jar

    Attempting a connection to bloop server 127.0.0.1:8212 ...
    Attempting a connection to bloop server 127.0.0.1:8212 ...
    Attempting a connection to bloop server 127.0.0.1:8212 ...
    Attempting a connection to bloop server 127.0.0.1:8212 ...
    Attempting a connection to bloop server 127.0.0.1:8212 ...
    Attempting a connection to bloop server 127.0.0.1:8212 ...
    Attempting a connection to bloop server 127.0.0.1:8212 ...
    Attempting a connection to bloop server 127.0.0.1:8212 ...
    Attempting a connection to bloop server 127.0.0.1:8212 ...
    Unable to load nailgun-version.properties.
    NGServer [UNKNOWN] started on address /127.0.0.1 port 8212.
    Attempting a connection to bloop server 127.0.0.1:8212 ...
    Bloop server started
    Opening BSP connection with bloop
    Bloop BSP connection waiting at local:/Users/alexandre/Library/Caches/ScalaCli/bsp-sockets/proc-80511
    BSP connection at /Users/alexandre/Library/Caches/ScalaCli/bsp-sockets/proc-80511 not found, waiting 100 milliseconds
    nailgun debug: Sending arguments '--protocol local --socket /Users/alexandre/Library/Caches/ScalaCli/bsp-sockets/proc-80511' to Nailgun server
    nailgun debug: Sending environment variables to Nailgun server
    nailgun debug: Sending working directory /Users/alexandre/projects/scala-cli/test/.scala to Nailgun server
    nailgun debug: Sending command to bsp Nailgun server
    nailgun debug: Finished sending command information to Nailgun server
    nailgun debug: Starting thread to read stdin...
    [W] Internal error in session
    java.io.EOFException
    BSP connection at /Users/alexandre/Library/Caches/ScalaCli/bsp-sockets/proc-80511 not found, waiting 100 milliseconds
    at java.base/java.io.DataInputStream.readInt(DataInputStream.java:397)
    at com.martiansoftware.nailgun.NGCommunicator.readCommandContext(NGCommunicator.java:140)
    at com.martiansoftware.nailgun.NGSession.run(NGSession.java:197)
    BSP connection at /Users/alexandre/Library/Caches/ScalaCli/bsp-sockets/proc-80511 not found, waiting 100 milliseconds
    BSP connection at /Users/alexandre/Library/Caches/ScalaCli/bsp-sockets/proc-80511 not found, waiting 100 milliseconds
    BSP connection at /Users/alexandre/Library/Caches/ScalaCli/bsp-sockets/proc-80511 not found, waiting 100 milliseconds
    BSP connection at /Users/alexandre/Library/Caches/ScalaCli/bsp-sockets/proc-80511 not found, waiting 100 milliseconds
    BSP connection at /Users/alexandre/Library/Caches/ScalaCli/bsp-sockets/proc-80511 not found, waiting 100 milliseconds
    BSP connection at /Users/alexandre/Library/Caches/ScalaCli/bsp-sockets/proc-80511 not found, waiting 100 milliseconds
    BSP connection at /Users/alexandre/Library/Caches/ScalaCli/bsp-sockets/proc-80511 opened
    Connected to Bloop via BSP at local:/Users/alexandre/Library/Caches/ScalaCli/bsp-sockets/proc-80511
    Connected to Bloop via BSP at local:/Users/alexandre/Library/Caches/ScalaCli/bsp-sockets/proc-80511
    nailgun debug: Received action Print([B@1c79f3a7) from Nailgun server
    The server is listening for incoming connections at local:///Users/alexandre/Library/Caches/ScalaCli/bsp-sockets/proc-80511...
    nailgun debug: Received action Print([B@274c0297) from Nailgun server
    Accepted incoming BSP client connection at local:///Users/alexandre/Library/Caches/ScalaCli/bsp-sockets/proc-80511
    Sending buildInitialize BSP command to Bloop
    nailgun debug: Received action Print([B@7af46130) from Nailgun server
    request received: build/initialize
    nailgun debug: Received action Print([B@29f9d46d) from Nailgun server
    BSP initialization handshake complete.
    Fetching List(org.scala-lang::scala3-compiler:3.0.2), adding List(https://oss.sonatype.org/content/repositories/snapshots, ivy:file:///Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7//[defaultPattern])
    Found 13 artifacts:
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.0.2/scala3-compiler_3-3.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-interfaces/3.0.2/scala3-interfaces-3.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.2/scala3-library_3-3.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/tasty-core_3/3.0.2/tasty-core_3-3.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-asm/9.1.0-scala-1/scala-asm-9.1.0-scala-1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.3.5/compiler-interface-1.3.5.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-reader/3.19.0/jline-reader-3.19.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal/3.19.0/jline-terminal-3.19.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal-jna/3.19.0/jline-terminal-jna-3.19.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.6/scala-library-2.13.6.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.7.0/protobuf-java-3.7.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.3.0/util-interface-1.3.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.3.1/jna-5.3.1.jar

    Fetching List(org.scala-lang::scala3-library::3.0.2, org.virtuslab.scala-cli::runner:0.0.5+43-g60eae701-SNAPSHOT), adding List(https://oss.sonatype.org/content/repositories/snapshots, ivy:file:///Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7//[defaultPattern])
    Fetching List(org.virtuslab.scala-cli:stubs:0.0.5+43-g60eae701-SNAPSHOT), adding List(https://oss.sonatype.org/content/repositories/snapshots, ivy:file:///Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7//[defaultPattern])
    Found 1 artifacts:
    /Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7/org.virtuslab.scala-cli/stubs/0.0.5+43-g60eae701-SNAPSHOT/jars/stubs.jar

    Writing bloop project in /Users/alexandre/projects/scala-cli/test/.scala/.bloop/project_940fb43dce.json
    Listing BSP build targets
    Compiling project_940fb43dce with Bloop
    Received onBuildTaskStart from bloop: TaskStartParams [
    taskId = TaskId [
    id = "1"
    parents = null
    ]
    eventTime = 1634309020072
    message = "Compiling project_940fb43dce (1 Scala source)"
    dataKind = "compile-task"
    data = {"target":{"uri":"file:/Users/alexandre/projects/scala-cli/test/.scala/?id=project_940fb43dce"}}
    ]
    Compiling project (Scala 3.0.2, JVM)
    Received onBuildTaskFinish from bloop: TaskFinishParams [
    taskId = TaskId [
    id = "1"
    parents = null
    ]
    eventTime = 1634309023968
    message = "Compiled 'project_940fb43dce'"
    status = OK
    dataKind = "compile-report"
    data = {"target":{"uri":"file:/Users/alexandre/projects/scala-cli/test/.scala/?id=project_940fb43dce"},"originId":null,"errors":0,"warnings":0,"time":null,"isNoOp":false,"isLastCycle":true,"clientDir":"file:///Users/alexandre/projects/scala-cli/test/.scala/project_940fb43dce/classes/main/","analysisOut":"file:///Users/alexandre/projects/scala-cli/test/.scala/.bloop/project_940fb43dce/project_940fb43dce-analysis.bin"}
    ]
    Compiled project (Scala 3.0.2, JVM)
    Compilation succeeded
    Post-processing class files of pre-processed sources
    Overwriting .scala/project_940fb43dce/classes/main/test$.class
    Overwriting .scala/project_940fb43dce/classes/main/test.class
    Overwriting .scala/project_940fb43dce/classes/main/test_sc$.class
    Overwriting .scala/project_940fb43dce/classes/main/test_sc.class
    Moving semantic DBs around
    Reading TASTy file /Users/alexandre/projects/scala-cli/test/.scala/project_940fb43dce/classes/main/test.tasty
    Parsed TASTy file /Users/alexandre/projects/scala-cli/test/.scala/project_940fb43dce/classes/main/test.tasty
    Overwriting .scala/project_940fb43dce/classes/main/test.tasty
    Reading TASTy file /Users/alexandre/projects/scala-cli/test/.scala/project_940fb43dce/classes/main/test_sc.tasty
    Parsed TASTy file /Users/alexandre/projects/scala-cli/test/.scala/project_940fb43dce/classes/main/test_sc.tasty
    Overwriting .scala/project_940fb43dce/classes/main/test_sc.tasty
    Fetching List(org.scala-lang::scala3-compiler:3.0.2), adding List(https://oss.sonatype.org/content/repositories/snapshots, ivy:file:///Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7//[defaultPattern])
    Found 13 artifacts:
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.0.2/scala3-compiler_3-3.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-interfaces/3.0.2/scala3-interfaces-3.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.2/scala3-library_3-3.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/tasty-core_3/3.0.2/tasty-core_3-3.0.2.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-asm/9.1.0-scala-1/scala-asm-9.1.0-scala-1.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.3.5/compiler-interface-1.3.5.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-reader/3.19.0/jline-reader-3.19.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal/3.19.0/jline-terminal-3.19.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal-jna/3.19.0/jline-terminal-jna-3.19.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.6/scala-library-2.13.6.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.7.0/protobuf-java-3.7.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.3.0/util-interface-1.3.0.jar
    /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.3.1/jna-5.3.1.jar

    Fetching List(org.scala-lang::scala3-library::3.0.2, org.virtuslab.scala-cli::runner:0.0.5+43-g60eae701-SNAPSHOT), adding List(https://oss.sonatype.org/content/repositories/snapshots, ivy:file:///Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7//[defaultPattern])
    Fetching List(org.virtuslab.scala-cli:stubs:0.0.5+43-g60eae701-SNAPSHOT), adding List(https://oss.sonatype.org/content/repositories/snapshots, ivy:file:///Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7//[defaultPattern])
    Found 1 artifacts:
    /Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7/org.virtuslab.scala-cli/stubs/0.0.5+43-g60eae701-SNAPSHOT/jars/stubs.jar

    Writing bloop project in /Users/alexandre/projects/scala-cli/test/.scala/.bloop/project_f643cb0bc2-test.json
    Listing BSP build targets
    Compiling project_f643cb0bc2-test with Bloop
    Compilation succeeded
    Post-processing class files of pre-processed sources
    Moving semantic DBs around
    Running
    /Users/alexandre/Library/Caches/Coursier/jvm/adopt@1.11.0-7/Contents/Home/bin/java
    -cp
    /Users/alexandre/projects/scala-cli/test/.scala/project_940fb43dce/classes/main:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.2/scala3-library_3-3.0.2.jar:/Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7/org.virtuslab.scala-cli/runner_3/0.0.5+43-g60eae701-SNAPSHOT/jars/runner_3.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.6/scala-library-2.13.6.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/oss.sonatype.org/content/repositories/snapshots/org/virtuslab/pretty-stacktraces_3/0.0.0%2B27-b9d69198-SNAPSHOT/pretty-stacktraces_3-0.0.0%2B27-b9d69198-SNAPSHOT.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-tasty-inspector_3/3.0.0/scala3-tasty-inspector_3-3.0.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.0.0/scala3-compiler_3-3.0.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-interfaces/3.0.0/scala3-interfaces-3.0.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/tasty-core_3/3.0.0/tasty-core_3-3.0.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-asm/9.1.0-scala-1/scala-asm-9.1.0-scala-1.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.3.5/compiler-interface-1.3.5.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-reader/3.19.0/jline-reader-3.19.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal/3.19.0/jline-terminal-3.19.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal-jna/3.19.0/jline-terminal-jna-3.19.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.7.0/protobuf-java-3.7.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.3.0/util-interface-1.3.0.jar:/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.3.1/jna-5.3.1.jar:/Users/alexandre/Library/Caches/ScalaCli/local-repo/v0.0.5-43-60eae7/org.virtuslab.scala-cli/stubs/0.0.5+43-g60eae701-SNAPSHOT/jars/stubs.jar
    scala.cli.runner.Runner
    test_sc

    execve available
    Hello
    Client in /Users/alexandre/projects/scala-cli/test/.scala/.bloop disconnected with a 'SocketError' event. Cancelling tasks...

    If you want to understand how Scala CLI works, the -v option shows you the details of what's happening when your command is run.

    - + \ No newline at end of file diff --git a/docs/guides/intro/index.html b/docs/guides/intro/index.html index 67a5f1c6ac..4c6e500ceb 100644 --- a/docs/guides/intro/index.html +++ b/docs/guides/intro/index.html @@ -4,7 +4,7 @@ Introduction | Scala CLI - + @@ -16,7 +16,7 @@ Scala CLI.
  • using directives - Scala CLI’s syntax that lets you store configuration information directly in source files
  • IDE support - how to import and use Scala CLI-based projects in your favorite IDE.
  • Scala Toolkit - how to use the Scala Toolkit dependency batch (and other dependency batches) in a Scala CLI project.
  • Migrating from the old scala runner - an in-depth look at all the differences between Scala CLI and the old scala script.
  • Scripting guides

    Guides on how to get started with Scala scripting with Scala CLI.

    • Scripting guide - covers how Scala CLI allows for powerful scripting with Scala.
    • Shebang - explains how to use the shebang sub-command in a script's shebang header.

    Advanced guides

    Less introductory guides on specific topics.

    • Scala.js and Scala Native - learn how Scala CLI supports these non-JVM platforms
    • Piping - covers how Scala CLI allows to work with piped sources.
    • Snippets - learn how to use command line snippets with Scala CLI.
    • Verbosity - learn how to control logs verbosity in Scala CLI.
    • Internals - learn about how Scala CLI works under the hood.

    ⚡️ --power mode guides

    • SBT and Mill export - learn how to convert your Scala CLI project into an SBT or Mill project (when you need a more powerful build tool).
    • proxies - learn how to configure Scala CLI to work with proxies.
    • Markdown - learn how to work with .md sources.
    - + \ No newline at end of file diff --git a/docs/guides/markdown/index.html b/docs/guides/markdown/index.html index 451ce4ca2c..f5f6948bc0 100644 --- a/docs/guides/markdown/index.html +++ b/docs/guides/markdown/index.html @@ -4,7 +4,7 @@ Markdown ⚡️ | Scala CLI - + @@ -35,7 +35,7 @@ Scopes are numbered according to their order in a given .md file (starting from 0 for the first plain scala snippet): Scope{scopeNumber}. The snippetNumber is omitted for the first script code block (0). In other words, the first scope is just Scope, the second is Scope1, then Scope2 and so on.

    src/markdown/Example.md
    ## Scope 0
    ```scala
    def hello: String = "Hello"
    ```

    ## Still scope 0, since `reset` wasn't used yet
    ```scala
    def space: String = " "
    ```

    ## Scope 1
    ```scala reset
    def world: String = "world"
    ```
    Main.scala
    object Main extends App {
    val hello = markdown.Example_md.Scope.hello
    val space = markdown.Example_md.Scope.space
    val world = markdown.Example_md.Scope1.world
    println(s"$hello$space$world")
    }
    scala-cli --power src Main.scala --enable-markdown --main-class Main
    Hello world

    scala raw and scala test code blocks

    You can refer to code from scala raw and scala test snippets as if they were the contents of a .scala file.

    RawSnippetToReferTo.md
    # `raw` snippet
    ```scala raw
    object Something {
    def message: String = "Hello"
    }
    ```
    scala-cli --power RawSnippetToReferTo.md -e 'println(Something.message)'
    Hello
    - + \ No newline at end of file diff --git a/docs/guides/old-runner-migration/index.html b/docs/guides/old-runner-migration/index.html index 354fedb06c..3a706f56c0 100644 --- a/docs/guides/old-runner-migration/index.html +++ b/docs/guides/old-runner-migration/index.html @@ -4,7 +4,7 @@ Migrating from the old Scala runner | Scala CLI - + @@ -81,7 +81,7 @@ the old scala script.

    scala-cli shebang Source.scala programArg1 programArg2

    For more concrete examples on how to change the shebang header in your existing scripts, look below.

    Example shebang script with the Scala 2.13.x old scala runner

    This is how an example shebang script could have looked like for the old scala runner with Scala 2.13.x

    old-scala-shebang-213.sc
    #!/usr/bin/env scala
    println("Args: " + args.mkString(" "))

    Example shebang script with the Scala 3.x old scala runner

    This in turn is the Scala 3.x equivalent for its own old scala runner.

    old-scala-shebang-3.sc
    #!/usr/bin/env scala
    @main def main(args: String*): Unit = println("Args: " + args.mkString(" "))

    Example shebang script with Scala CLI

    This is an example of how a Scala CLI script with a shebang header looks like.

    scala-cli-shebang.sc
    #!/usr/bin/env -S scala-cli shebang
    println("Args: " + args.mkString(" "))

    The example above refers scala-cli, as per the current default Scala CLI distribution. If you have Scala CLI installed as scala, then that should be changed to the following:

    scala-cli-as-scala-shebang.sc
    #!/usr/bin/env -S scala shebang
    println("Args: " + args.mkString(" "))

    For more information about the shebang sub-command, refer to the appropriate doc. For more details on how to use Scala CLI in shebang scripts, refer to the relevant guide.

    - + \ No newline at end of file diff --git a/docs/guides/piping/index.html b/docs/guides/piping/index.html index c240084c16..c1defcfca0 100644 --- a/docs/guides/piping/index.html +++ b/docs/guides/piping/index.html @@ -4,7 +4,7 @@ Piping | Scala CLI - + @@ -13,7 +13,7 @@ It is also possible to pass a script or Java code, when using the appropriate wildcard. The available options are as follows:

    • for standard Scala code use _, _.scala or -.scala;
    • for Scala scripts use -, _.sc or -.sc;
    • for Java code use _.java or -.java;
    • for Markdown code use _.md or -.md.

    Examples

    • scripts
    echo 'println("Hello")' | scala-cli _.sc
    Hello
    • Scala code
    echo '@main def hello() = println("Hello")' | scala-cli _.scala
    Hello
    • Java code
    echo 'class Hello { public static void main(String args[]) { System.out.println("Hello"); } }' | scala-cli _.java
    Hello
    • Markdown code (experimental)
    echo '# Example Snippet
    ```scala
    println("Hello")
    ```' | scala-cli _.md
    Hello

    Mixing piped sources with on-disk ones

    It is also possible to pipe some code via standard input, while the rest of your code is on-disk.

    echo 'case class HelloMessage(msg: String)' > HelloMessage.scala
    echo '@main def hello() = println(HelloMessage(msg = "Hello").msg)' | scala-cli _ HelloMessage.scala
    Hello

    You can even refer to code from piped scripts, when needed. A piped script can be referred to by its wrapper name stdin, as in the example below.

    echo '@main def main() = println(stdin.message)' > PrintMessage.scala
    echo 'def message: String = "Hello"' | scala-cli PrintMessage.scala _.sc
    Hello
    - + \ No newline at end of file diff --git a/docs/guides/proxies/index.html b/docs/guides/proxies/index.html index 2a3a4ba63a..06807d0a80 100644 --- a/docs/guides/proxies/index.html +++ b/docs/guides/proxies/index.html @@ -4,7 +4,7 @@ Proxies ⚡️ | Scala CLI - + @@ -17,7 +17,7 @@ env:ENV_VAR_NAME, file:/path/to/file, or command:command to run.

    Default repositories

    If you don't rely on proxies, but rather download artifacts through different Maven repositories, set those repositories like:

    scala-cli --power config repositories.default https://first-repo.company.com https://second-repo.company.com

    Mirrors

    If you're fine directly downloading artifacts from the internet, but would rather have some repositories requests go through a repository of yours, configure mirror repositories, like

    scala-cli --power config repositories.mirrors https://repo1.maven.org/maven2=https://repository.company.com/maven

    To have all requests to a Maven repository go through a repository of yours, do

    scala-cli --power config repositories.mirrors maven:*=https://repository.company.com/maven
    - + \ No newline at end of file diff --git a/docs/guides/sbt-mill/index.html b/docs/guides/sbt-mill/index.html index 84c9bf4920..905e24d5da 100644 --- a/docs/guides/sbt-mill/index.html +++ b/docs/guides/sbt-mill/index.html @@ -4,7 +4,7 @@ SBT and Mill ⚡️ | Scala CLI - + @@ -17,7 +17,7 @@ But at the same time, we don’t want to introduce the complexity that multi-module builds and tasks and plugin systems introduce — at least not until that complexity is needed.

    To export a project, run this command to export to sbt:

    scala-cli export --sbt <standard-options>

    Or use this command to export to Mill:

    scala-cli export --mill <standard-options>

    These commands create a copy of your sources, resources, and local JARs. They also download gists and other non-local inputs. By default the project is exported to a dest directory, but you can control that with the -o option.

    - + \ No newline at end of file diff --git a/docs/guides/scala-js/index.html b/docs/guides/scala-js/index.html index 86b9a8f6d3..f75075623c 100644 --- a/docs/guides/scala-js/index.html +++ b/docs/guides/scala-js/index.html @@ -4,7 +4,7 @@ Scala.js | Scala CLI - + @@ -13,7 +13,7 @@ like scalajs-bundler has. For this, you'll have to handle bundling yourself, with the .js file generated by Scala CLI.

    In order to run Scala.js sources, node is required.

    Configuration

    Enable Scala.js support by passing --js to Scala CLI, such as:

    scala-cli Test.scala --js

    Dependencies

    This section is currently a work in progress, but here are some initial notes:

    • Beware platform dependencies
    • run / test / package should all work

    Package

    Packaging Scala.js applications results in a .js file, that can be run with node:

    HelloJs.scala
    import scala.scalajs.js

    object Hello {
    def main(args: Array[String]): Unit = {
    val console = js.Dynamic.global.console
    val msg = "Hello World from Scala.js"
    console.log(msg)
    }
    }
    scala-cli --power package --js HelloJs.scala -o hello.js
    node hello.js
    # Hello World from Scala.js

    Module Split Style

    Smallest Modules

    Passing --js-module-split-style smallestmodules to the package sub-command creates js modules that are as small as possible. Scala.js linker generates a lot of js modules, which are copied to the output directory.

    SmallestModules.scala
    import scala.scalajs.js

    case class Foo(txt: String)

    object Hello extends App {
    println(Foo("Hello World from Scala.js").txt)
    }
    scala-cli --power package --js SmallestModules.scala --js-module-split-style smallestmodules --js-module-kind es --output hello
    echo "{\"type\": \"module\"}" >> package.json # enable ES module
    node hello/main.js
    # Hello World from Scala.js

    Small Modules For

    Passing --js-module-split-style smallestmodules to the package sub-command creates many small modules as possibles for the classes in the listed packages (and their subpackages). To define packages use jsSmallModuleForPackage parameter.

    SmallestModules.scala
    //> using jsModuleKind es
    //> using jsModuleSplitStyleStr smallmodulesfor
    //> using jsSmallModuleForPackage com.example.test com.example.example

    package com.example.test

    import scala.scalajs.js

    case class Foo(txt: String)

    object Hello extends App {
    println(Foo("Hello World from Scala.js").txt)
    }

    Emit source maps

    Passing --js-emit-source-maps to the package sub-command emits source maps alongside js files. To set the destination path of source maps, pass --js-source-maps-path flag with the argument.

    The following command emits a main.js.map alongside js files:

    sample.sc
    println("sample")
    scala-cli --power package sample.sc --js --js-emit-source-maps
    Emitted js source maps to: ./Hello.js.map
    Wrote Hello.js, run it with
    node ./Hello.js

    Scala.js DOM support

    Pass --js-dom to compile, run, or test to simulate a DOM in Node.js

    note

    If you see the following error, it means that you don't have the jsdom library installed to simulate the DOM.

    Error: Cannot find module 'jsdom'

    To fix it, install jsdom locally for your project. You can install install jsdom as follows:

    npm init private
    npm install jsdom
    Hello.scala
    //> using dep org.scala-js::scalajs-dom::2.1.0
    //> using platform scala-js

    object Hello {
    def main(args: Array[String]): Unit = {
    val parNode = document.createElement("p")
    parNode.textContent = "Hello World"
    document.body.appendChild(parNode)
    }
    }
    scala-cli sample.sc --js-dom

    Using Directives

    Scala.js options are supported by using directives in Scala CLI:

    --js-version

    The Scala.js version

    --js-header

    A header that will be added at the top of generated .js files

    For more options, see our using directive section.

    Supported Scala.js Versions

    In the future, the Scala CLI will be able to support any version of Scala.js independently of the version of scala-cli. But for now, there are some limitations and it isn't possible to use each version of Scala.js.

    The table below lists the last supported version of Scala.js in Scala CLI. If you want to use newer Scala.js, update scala-cli.

    Scala CLI versionsScala.js
    0.0.91.7.1
    0.1.0 - 0.1.21.8.0
    0.1.31.9.0
    0.1.4 - 0.1.81.10.0
    0.1.9 - 0.1.171.10.1
    0.1.18 - 0.2.01.12.0
    0.2.1 - 1.0.0-RC11.13.0
    1.0.0-RC2 - 1.0.21.13.1
    1.0.3- current1.13.2
    - + \ No newline at end of file diff --git a/docs/guides/scala-native/index.html b/docs/guides/scala-native/index.html index e032dfecac..1e7db92443 100644 --- a/docs/guides/scala-native/index.html +++ b/docs/guides/scala-native/index.html @@ -4,14 +4,14 @@ Scala Native | Scala CLI - +

    Scala Native

    Scala Native works with Scala 3.1.x, 2.13.x and 2.12.x. Scripts are unavailable for Scala 2.12.x.

    Scala Native requires the LLVM toolchain - see requirements on Scala Native website.

    Configuration

    Enable Scala Native support by passing --native to Scala CLI, such as:

    scala-cli Test.scala --native

    A Scala Native version can be set by passing --native-version with an argument:

    scala-cli Test.scala --native --native-version 0.4.3

    Platform compatibility and supported Scala language versions depend on this version.
    It is recommended to use the newest stable version.

    Dependencies

    This section is currently a work in progress, but here are some initial notes:

    • Beware platform dependencies
    • compile / run / test / package should all work
    - + \ No newline at end of file diff --git a/docs/guides/scripts/index.html b/docs/guides/scripts/index.html index 68b7a7711a..d3134dbbbc 100644 --- a/docs/guides/scripts/index.html +++ b/docs/guides/scripts/index.html @@ -4,7 +4,7 @@ Scripts | Scala CLI - + @@ -22,7 +22,7 @@ Note that those files are always run as scripts even though they may contain e.g. valid .scala program.

    Arguments

    You may also pass arguments to your script, and they are referenced with the special args variable:

    p.sc
    #!/usr/bin/env -S scala-cli shebang

    println(args(1))
    chmod +x p.sc
    ./p.sc hello world
    world

    The name of script

    You can access the name of the running script inside the script itself using the special scriptPath variable:

    script.sc
    #!/usr/bin/env -S scala-cli shebang

    println(scriptPath)
    chmod +x script.sc
    ./script.sc
    ./script.sc

    Define source files in using directives

    You can also add source files with the using directive //> using file in Scala scripts:

    main.sc
    //> using file Utils.scala

    println(Utils.message)
    Utils.scala
    object Utils {
    val message = "Hello World"
    }

    Scala CLI takes into account and compiles Utils.scala.

    scala-cli main.sc
    Hello World

    Difference with Ammonite scripts

    Ammonite is a popular REPL for Scala that can also compile and run .sc files.

    Scala CLI and Ammonite are similar, but differ significantly when your code is split in multiple scripts:

    • In Ammonite, a script needs to use import $file directives to use values defined in another script
    • With Scala CLI, all scripts passed can reference each other without such directives

    On the other hand:

    • You can pass a single "entry point" script as input to Ammonite, and Ammonite finds the scripts it depends on via the import $file directives
    • Scala CLI requires all scripts to be passed beforehand, either one-by-one, or by putting them in a directory, and passing the directory to Scala CLI
    - + \ No newline at end of file diff --git a/docs/guides/shebang/index.html b/docs/guides/shebang/index.html index 0760363416..2ff454a4d7 100644 --- a/docs/guides/shebang/index.html +++ b/docs/guides/shebang/index.html @@ -4,7 +4,7 @@ Shebang | Scala CLI - + @@ -14,7 +14,7 @@ Here is a simple hello.sc script with a shebang header:

    hello.sc
    #!/usr/bin/env -S scala-cli -S 3

    println(args.size)
    println(args.headOption)

    And it works correctly:

    chmod +x hello.sc
    ./hello.sc
    0
    None

    And it also works:

    ./hello.sc -- Hello World
    2
    Some(Hello)

    Note that the extra -- must be added to make it work. If it is not supplied, the result is:

    ./hello.sc Hello World
    [error] Hello: input file not found
    World: input file not found

    If we modify our script slightly and use the shebang sub-command in the header, we will get the following:

    hello.sc
    #!/usr/bin/env -S scala-cli shebang -S 3

    println(args.size)
    println(args.headOption)
    ./hello.sc Hello World
    2
    Some(Hello)

    shebang and the command line

    Let's now see how the shebang command works straight from the command line.

    Main.scala
    object Main {
    def main(args: Array[String]): Unit = println(args.mkString(" "))
    }
    scala-cli shebang Main.scala Hello world
    Hello world
    note

    Please note that shebang changing how arguments are parsed means that every option after the first input will be treated as an argument to the app.

    scala-cli shebang Main.scala -S 2.13 #-S 2.13 is not recognised as an option, but as app arguments
    -S 2.13

    If we try to do the same with the run sub-command, we get the following error:

    scala-cli run Main.scala Hello world
    [error]  Hello: input file not found
    world: input file not found

    Script files' extensions

    When running the shebang subcommand, script files don't need the .sc extension, but they are then REQUIRED to start with a shebang line:

    hello-with-shebang
    #!/usr/bin/env -S scala-cli shebang -S 3

    println(args.size)
    println(args.headOption)
    chmod +x hello-with-shebang
    ./hello-with-shebang Hello World
    2
    Some(Hello)
    hello-no-shebang
    println(args.size)
    println(args.headOption)
    chmod +x hello-no-shebang
    scala-cli shebang hello-no-shebang Hello World
    hello-no-shebang: unrecognized source type (expected .scala or .sc extension, or a directory)
    note

    Files with no extensions are always run as scripts even though they may contain e.g. valid .scala program.

    - + \ No newline at end of file diff --git a/docs/guides/snippets/index.html b/docs/guides/snippets/index.html index 872d61e8ce..e202de9439 100644 --- a/docs/guides/snippets/index.html +++ b/docs/guides/snippets/index.html @@ -4,7 +4,7 @@ Snippets | Scala CLI - + @@ -19,7 +19,7 @@ actually be run with the --main-class option when multiple scripts are present on the classpath (and no non-script main class was passed).

    ondisk.sc
    println(s"${stdin.hello} ${snippet.world}${snippet1.exclamation}")
    echo 'def hello = "Hello"' | scala-cli _.sc ondisk.sc -e 'def world = "world"' -e 'def exclamation = "!"' --main-class ondisk_sc
    Hello world!

    When in doubt on what main classes are available on the classpath, you can always refer to the output of --list-main-classes

    echo 'def hello = "Hello"' | scala-cli _.sc ondisk.sc -e 'def world = "world"' -e 'def exclamation = "!"' --list-main-classes
    ondisk_sc snippet_sc stdin_sc
    - + \ No newline at end of file diff --git a/docs/guides/toolkit/index.html b/docs/guides/toolkit/index.html index 0ba563de1e..302542c71f 100644 --- a/docs/guides/toolkit/index.html +++ b/docs/guides/toolkit/index.html @@ -4,7 +4,7 @@ Scala Toolkit | Scala CLI - + @@ -20,7 +20,7 @@ structure of 2 dependencies with the names toolkit and toolkit-test. To do so, you have to explicitly pass the organisation the toolkit was released under (or an alias if defined).

    For example, to add the Typelevel Toolkit to your project, you can pass it with the --toolkit option:

    UseTypelevel.scala
    import cats.effect.*
    import fs2.io.file.Files

    object Hello extends IOApp.Simple {
    def run = Files[IO].currentWorkingDirectory.flatMap { cwd =>
    IO.println(cwd.toString)
    }
    }
    scala-cli UseTypelevel.scala --toolkit org.typelevel:latest
    scala-cli UseTypelevel.scala --toolkit typelevel:latest # typelevel has a shorter alias defined

    Similarly, you can achieve the same with the using toolkit directive:

    //> using toolkit org.typelevel:latest

    import cats.effect.*
    import fs2.io.file.Files

    object Hello extends IOApp.Simple {
    def run = Files[IO].currentWorkingDirectory.flatMap { cwd =>
    IO.println(cwd.toString)
    }
    }

    Or with the alias:

    //> using toolkit typelevel:latest

    import cats.effect.*
    import fs2.io.file.Files

    object Hello extends IOApp.Simple {
    def run = Files[IO].currentWorkingDirectory.flatMap { cwd =>
    IO.println(cwd.toString)
    }
    }
    - + \ No newline at end of file diff --git a/docs/guides/update-dependencies/index.html b/docs/guides/update-dependencies/index.html index d969b4b967..451e7ee4e3 100644 --- a/docs/guides/update-dependencies/index.html +++ b/docs/guides/update-dependencies/index.html @@ -4,13 +4,13 @@ Updating dependencies | Scala CLI - +

    Updating dependencies

    To check if dependencies in using directives are up-to-date, use dependency-update command:

    Hello.scala
    //> using dep com.lihaoyi::os-lib:0.7.8
    //> using dep com.lihaoyi::utest:0.7.10

    object Hello extends App {
    println("Hello World")
    }
    scala-cli --power dependency-update Hello.scala
    Updates
    * com.lihaoyi::os-lib:0.7.8 -> 0.8.1
    * com.lihaoyi::utest:0.7.10 -> 0.8.0
    To update all dependencies run:
    scala-cli dependency-update --all

    Passing --all to the dependency-update sub-command updates all dependencies in your sources.

    scala-cli --power dependency-update Hello.scala --all
    Updated dependency to: com.lihaoyi::os-lib:0.8.1
    Updated dependency to: com.lihaoyi::utest:0.8.0
    - + \ No newline at end of file diff --git a/docs/guides/using-directives/index.html b/docs/guides/using-directives/index.html index 957f6533e7..2e31af345f 100644 --- a/docs/guides/using-directives/index.html +++ b/docs/guides/using-directives/index.html @@ -4,7 +4,7 @@ Using directives | Scala CLI - + @@ -35,7 +35,7 @@ with two dollar signs ($$), like this:

    //> using options -coverage-out:$${.}

    How to comment out using directives?

    Using directives are part of the code so similarly, developers should be able to comment them out.

    Commenting out comment-based directives does not cause any problems. Below, some examples how to do it:

    // //> using dep "no::lib:123"
    // // using dep "no::lib:123"

    Directives with a test scope equivalent

    Some directives have a test scope equivalent. For example, using dep has using test.dep, which allows to declare dependencies that are only used in tests outside test-specific sources.

    For example, this way you can declare the dependency to munit in project.scala like this:

    project.scala
    //> using test.dep org.scalameta::munit::0.7.29

    The dependency will then only be available in test sources. It's effectively an equivalent to just using dep inside of a test source (except you can define it anywhere):

    src/test/scala/Tests.scala
    //> using dep org.scalameta::munit::0.7.29

    Directives with a test scope equivalent:

    //> using test.dep org.scalameta::munit::0.7.29
    //> using test.jar path/to/dep.jar
    //> using test.sourceJar path/to/some-sources.jar
    //> using test.javaOpt -Dfoo=bar
    //> using test.javacOpt source 1.8 target 1.8
    //> using test.javaProp foo1=bar1
    //> using test.option -Xfatal-warnings
    //> using test.resourceDir testResources
    //> using test.toolkit latest
    - + \ No newline at end of file diff --git a/docs/guides/verbosity/index.html b/docs/guides/verbosity/index.html index 58ef5a25f6..6e95c8014c 100644 --- a/docs/guides/verbosity/index.html +++ b/docs/guides/verbosity/index.html @@ -4,7 +4,7 @@ Verbosity | Scala CLI - + @@ -15,7 +15,7 @@ The relevant warnings can be suppressed with the --suppress-outdated-dependency-warning option.

    scala-cli Deps1.sc Deps2.sc --suppress-outdated-dependency-warning

    Alternatively, the global config key suppress-warning.directives-in-multiple-files can be used.

    scala-cli config suppress-warning.directives-in-multiple-files true

    Warnings about experimental features' usage

    Using experimental features produces warnings, which can be suppressed with the --suppress-experimental-warning option.

    scala-cli --power run --suppress-experimental-warning --markdown-snippet '# Markdown snippet
    with a code block
    ```scala
    println("Hello")
    ```'

    Alternatively, the global config key suppress-warning.experimental-features can be used.

    scala-cli config suppress-warning.experimental-features true

    Warnings about having outdated dependencies

    OldDeps.sc
    //> using dep com.lihaoyi::pprint:0.6.6

    Depending on outdated libraries produces warnings, which can be suppressed with the --suppress-outdated-dependencies-warning option.

    scala-cli OldDeps.sc --suppress-outdated-dependencies-warning

    Alternatively, the global config key suppress-warning.outdated-dependencies-files can be used.

    scala-cli config suppress-warning.outdated-dependencies-files true
    - + \ No newline at end of file diff --git a/docs/overview/index.html b/docs/overview/index.html index 640d0cfa96..ae6071224a 100644 --- a/docs/overview/index.html +++ b/docs/overview/index.html @@ -4,13 +4,13 @@ Overview | Scala CLI - +

    Overview

    The Scala CLI makes it easier to compile, run, test, and package Scala code.

    It can:

    • compile Scala code
    • run it
    • package it as a JAR file, or in formats such as deb, rpm, MSI, ...
    • fire up a REPL, letting you quickly play with the code
    • compile and run tests suites

    ... and more!

    Scala CLI supports most recent Scala versions (3.x, 2.13.x and 2.12.x), and changing the Scala version as easy as providing the --scala parameter. (See the cookbook for more information.)

    As well as compiling and running Scala code with the JVM (the default), Scala CLI also supports Scala.js and Scala Native.

    Installation

    Prefer another way to install Scala CLI? See our Advanced installation guide.

    What’s next?

    Scala-CLI documentation is split into three main sections:

    • Getting started, where you learn how to start with Scala CLI
    • Commands, where you learn the most important Scala CLI commands
    • Guides, where you can read about the core aspects of Scala CLI, and learn how Scala CLI interacts with other tools, like your IDE
    • Scala CLI Cookbook, where you can learn how to solve specific problems with Scala CLI

    Happy hacking with Scala CLI!

    Demo

    - + \ No newline at end of file diff --git a/docs/reference/bloop/index.html b/docs/reference/bloop/index.html index b640f1d1e1..b48a849c6f 100644 --- a/docs/reference/bloop/index.html +++ b/docs/reference/bloop/index.html @@ -4,13 +4,13 @@ Interaction with Bloop server | Scala CLI - + - + \ No newline at end of file diff --git a/docs/reference/build-info/index.html b/docs/reference/build-info/index.html index f20ab84ed8..44b67acb42 100644 --- a/docs/reference/build-info/index.html +++ b/docs/reference/build-info/index.html @@ -4,7 +4,7 @@ BuildInfo | Scala CLI - + @@ -17,7 +17,7 @@ //> using buildInfo directive.

    Usage

    The generated BuildInfo object is available on the project's classpath. To access it you need to import it first. It is available in the package scala.cli.build so use

    import scala.cli.build.BuildInfo

    to import it.

    Below you can find an example instance of the BuildInfo object, with all fields explained. Some of the values have been shortened for readability.

    package scala.cli.build

    /** Information about the build gathered by Scala CLI */
    object BuildInfo {
    /** version of Scala used to compile this project */
    val scalaVersion = "3.3.0"
    /** target platform of this project, it can be "JVM" or "JS" or "Native" */
    val platform = "JVM"
    /** version of JVM, if it's the target platform */
    val jvmVersion = Some("11")
    /** version of Scala.js, if it's the target platform */
    val scalaJsVersion = None
    /** Scala.js ECMA Script version, if Scala.js is the target platform */
    val jsEsVersion = None
    /** version of Scala Native, if it's the target platform */
    val scalaNativeVersion = None
    /** Main class specified for the project */
    val mainClass = Some("Main")
    /** Project version */
    val projectVersion = None

    /** Information about the Main scope */
    object Main {
    /** sources found for the scope */
    val sources = Seq(".../Main.scala")
    /** scalac options for the scope */
    val scalacOptions = Seq("-Werror")
    /** compiler plugins used in this scope */
    val scalaCompilerPlugins = Nil
    /** dependencies used in this scope */
    val dependencies = Seq("com.lihaoyi:os-lib_3:0.9.1")
    /** dependency resolvers used in this scope */
    val resolvers = Seq("https://repo1.maven.org/maven2", "ivy:file:...")
    /** resource directories used in this scope */
    val resourceDirs = Seq(".../resources")
    /** custom jars added to this scope */
    val customJarsDecls = Seq(".../AwesomeJar1.jar", ".../AwesomeJar2.jar")
    }

    /** Information about the Test scope */
    object Test {
    /** sources found for the scope */
    val sources = Seq(".../MyTests.scala")
    /** scalac options for the scope */
    val scalacOptions = Seq("-Vdebug")
    /** compiler plugins used in this scope */
    val scalaCompilerPlugins = Nil
    /** dependencies used in this scope */
    val dependencies = Seq("org.scala-lang:toolkit_3:latest.release")
    /** dependency resolvers used in this scope */
    val resolvers = Seq("https://repo1.maven.org/maven2", "ivy:file:...")
    /** resource directories used in this scope */
    val resourceDirs = Seq(".../test/resources")
    /** custom jars added to this scope */
    val customJarsDecls = Nil
    }
    }
    - + \ No newline at end of file diff --git a/docs/reference/cli-options/index.html b/docs/reference/cli-options/index.html index b9e94899ec..d46ef80f1c 100644 --- a/docs/reference/cli-options/index.html +++ b/docs/reference/cli-options/index.html @@ -4,7 +4,7 @@ Command-line options | Scala CLI - + @@ -92,7 +92,7 @@ When running Scala CLI on the JVM, force running scala-cli-singing externally

    --force-jvm-signing-cli

    [Internal] When running Scala CLI on the JVM, force running scala-cli-singing using a native launcher or a JVM launcher

    Pgp sign options

    Available in commands:

    pgp sign

    --password

    [Internal]

    --secret-key

    [Internal]

    --force

    Aliases: -f

    [Internal]

    --stdout

    [Internal]

    Pgp verify options

    Available in commands:

    pgp verify

    --key

    [Internal]

    Setup IDE options

    Available in commands:

    setup-ide

    --charset

    [Internal]

    Workspace options

    Available in commands:

    bsp, clean, compile, dependency-update, doc, export, fmt , format , scalafmt, package, publish, publish local, publish setup, repl , console, run, setup-ide, shebang, test

    --workspace

    [Internal] Directory where .scala-build is written

    - + \ No newline at end of file diff --git a/docs/reference/commands/index.html b/docs/reference/commands/index.html index fa910cc546..5f1371bacf 100644 --- a/docs/reference/commands/index.html +++ b/docs/reference/commands/index.html @@ -4,7 +4,7 @@ Commands | Scala CLI - + @@ -97,7 +97,7 @@ For more information about Bloop, refer to https://scalacenter.github.io/bloop/

    Accepts option groups: bloop start, compilation server, coursier, debug, global suppress warning, jvm, logging, verbosity

    bsp

    Start BSP server.

    BSP stands for Build Server Protocol. For more information refer to https://build-server-protocol.github.io/

    This sub-command is not designed to be used by a human. It is normally supposed to be invoked by your IDE when a Scala CLI project is imported.

    Detailed documentation can be found on our website: https://scala-cli.virtuslab.org

    Accepts option groups: bsp, compilation server, coursier, debug, dependency, global suppress warning, help group, input, jvm, logging, markdown, python, Scala.js, Scala Native, scalac, scalac extra, shared, snippet, source generator, suppress warning, verbosity, version, workspace

    default-file

    Generates default files for a Scala CLI project (i.e. .gitignore).

    For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/misc/default-file

    Accepts option groups: default file, global suppress warning, logging, verbosity

    directories

    Prints directories used by Scala CLI.

    Accepts option groups: global suppress warning, logging, verbosity

    install-home

    Install Scala CLI in a sub-directory of the home directory

    Accepts option groups: global suppress warning, install home, logging, verbosity

    pgp pull

    Accepts option groups: global suppress warning, logging, pgp pull, pgp push pull, verbosity

    pgp push

    Accepts option groups: coursier, debug, global suppress warning, jvm, logging, pgp push, pgp push pull, pgp scala signing, verbosity

    pgp create

    Create PGP key pair

    Accepts option groups: pgp create

    pgp key-id

    Accepts option groups: pgp key id

    pgp sign

    Sign files with PGP

    Accepts option groups: pgp sign

    pgp verify

    Verify PGP signatures

    Accepts option groups: pgp verify

    - + \ No newline at end of file diff --git a/docs/reference/dependency/index.html b/docs/reference/dependency/index.html index 0ff68293f9..8adc9bcbfe 100644 --- a/docs/reference/dependency/index.html +++ b/docs/reference/dependency/index.html @@ -4,13 +4,13 @@ Dependency format | Scala CLI - +

    Dependency format

    • Same as Mill

    • first : — scala version suffix

      • single : — no scala version suffix
      • double :: — scala binary version suffix
      • triple ::: — full scala version suffix
    • second : — scala platform suffix

      • single : — no platform suffix
      • double :: — platform suffix, if any
    - + \ No newline at end of file diff --git a/docs/reference/directives/index.html b/docs/reference/directives/index.html index f4bc0d1a85..70b9796d7c 100644 --- a/docs/reference/directives/index.html +++ b/docs/reference/directives/index.html @@ -4,7 +4,7 @@ Directives | Scala CLI - + @@ -18,7 +18,7 @@ //> using publish.repository value //> using publish.secretKey value //> using publish.doc boolean

    Examples

    //> using publish.computeVersion git:tag

    //> using publish.repository central-s01

    //> using publish.secretKey env:PUBLISH_SECRET_KEY

    //> using publish.doc false

    Python

    Enable Python support

    //> using python

    Examples

    //> using python

    Repository

    Add repositories for dependency resolution.

    Accepts predefined repositories supported by Coursier (like sonatype:snapshots or m2Local) or a URL of the root of Maven repository

    //> using repository repository

    Examples

    //> using repository jitpack

    //> using repository sonatype:snapshots

    //> using repository m2Local

    //> using repository https://maven-central.storage-download.googleapis.com/maven2

    Resource directories

    Manually add a resource directory to the class path

    //> using resourceDir path

    //> using resourceDirs path1 path2

    Examples

    //> using resourceDir ./resources

    //> using test.resourceDir ./resources

    Scala Native options

    Add Scala Native options

    //> using nativeGc value

    //> using nativeMode value

    //> using nativeLto value

    //> using nativeVersion value

    //> using nativeCompile value1 value2

    //> using nativeLinking value1 value2

    //> using nativeClang value

    //> using nativeClangPP value

    //> using nativeEmbedResources true|false

    Examples

    //> using nativeVersion 0.4.0

    Scala version

    Set the default Scala version

    //> using scala version+

    Examples

    //> using scala 3.0.2

    //> using scala 2.13

    //> using scala 2

    //> using scala 2.13.6, 2.12.16

    Scala.js options

    Add Scala.js options

    //> using jsVersion value

    //> using jsMode value

    //> using jsModuleKind value

    //> using jsSmallModuleForPackage value1 value2

    //> using jsCheckIr true|false

    //> using jsEmitSourceMaps true|false

    //> using jsDom true|false

    //> using jsHeader value

    //> using jsAllowBigIntsForLongs true|false

    //> using jsAvoidClasses true|false

    //> using jsAvoidLetsAndConsts true|false

    //> using jsModuleSplitStyleStr value

    //> using jsEsVersionStr value

    Examples

    //> using jsModuleKind common

    Test framework

    Set the test framework

    //> using testFramework class_name

    Examples

    //> using testFramework utest.runner.Framework

    Toolkit

    Use a toolkit as dependency

    //> using toolkit version

    Examples

    //> using toolkit 0.1.0

    //> using toolkit latest

    //> using test.toolkit latest

    target directives

    Platform

    Require a Scala platform for the current file

    //> using target.platform platform

    Examples

    //> using target.platform scala-js

    //> using target.platform scala-js, scala-native

    //> using target.platform jvm

    Scala version

    Require a Scala version for the current file

    //> using target.scala version

    Examples

    //> using target.scala 3

    Scala version bounds

    Require a Scala version for the current file

    //> using target.scala.>= version

    Examples

    //> using target.scala.>= 2.13

    //> using target.scala.< 3.0.2

    Scope

    Require a scope for the current file

    //> using target.scope scope

    Examples

    //> using target.scope test

    - + \ No newline at end of file diff --git a/docs/reference/password-options/index.html b/docs/reference/password-options/index.html index 62ce190005..cec6e63d86 100644 --- a/docs/reference/password-options/index.html +++ b/docs/reference/password-options/index.html @@ -4,7 +4,7 @@ Password options ⚡️ | Scala CLI - + @@ -16,7 +16,7 @@ inline.

    Environment variable

    Prefix the environment variable name with env:, like

    $ export MY_PASSWORD=1234
    $ scala-cli publish . --repo-password env:MY_PASSWORD

    Command printing the secret

    Prefix the command printing the secret with command:, like

    $ get-secret sonatype-s01 # command printing the secret
    1234
    $ scala-cli publish . --repo-password "command:get-secret sonatype-s01"

    Alternatively, if some of the command arguments contain spaces, one can pass a JSON list:

    $ get-secret "sonatype s01" # command printing the secret
    1234
    $ scala-cli publish . --repo-password 'command:["get-secret", "sonatype s01"]'

    File

    Prefix the file path with file:, like

    $ cat "$HOME/.passwords/sonatype-s01"
    1234
    $ scala-cli publish . --repo-password "file:$HOME/.passwords/sonatype-s01"

    Inline

    This is the less secure way of passing secrets to Scala CLI, and should only be used for debugging purposes, with non-sensitive secrets. Prefix the password / secret value with value:, like

    $ scala-cli publish . --repo-password value:1234
    - + \ No newline at end of file diff --git a/docs/reference/proxy-authentication/index.html b/docs/reference/proxy-authentication/index.html index 37afc555b4..6709ee7d52 100644 --- a/docs/reference/proxy-authentication/index.html +++ b/docs/reference/proxy-authentication/index.html @@ -4,7 +4,7 @@ Proxy authentication | Scala CLI - + @@ -12,7 +12,7 @@

    Proxy authentication

    Scala CLI can download dependencies via HTTP proxies. Proxies can be setup in several ways:

    • via the Maven configuration file (recommended for now)
    • via command-line options
    • via Scala CLI or coursier configuration files (soon)

    Maven configuration file

    This file lives at ~/.m2/settings.xml

    Example configuration file, without authentication:

    <settings>
    <proxies>
    <proxy>
    <id>test-proxy</id>
    <protocol>http</protocol>
    <host>proxy.corp.com</host>
    <port>8080</port>
    </proxy>
    </proxies>
    </settings>

    Example configuration file, with authentication:

    <settings>
    <proxies>
    <proxy>
    <id>test-proxy</id>
    <protocol>http</protocol>
    <host>proxy.corp.com</host>
    <port>8080</port>
    <username>alex</username>
    <password>1234</password>
    </proxy>
    </proxies>
    </settings>

    The value in <protocol>…</protocol> is assumed to be the protocol of the proxy itself (can be either http or https, https is assumed by default not to inadvertently leak proxy credentials).

    Such a proxy is used for both http and https by Scala CLI.

    The coursier command-line and library also pick those credentials, since version 2.1.0-M6-26-gcec901e9a (2022/05/31).

    Command-line options

    Example

    $ scala-cli \
    -Dhttp.proxyProtocol=http -Dhttp.proxyHost=proxy.corp.com -Dhttp.proxyPort=8080 \
    -Dhttp.proxyUsername=alex -Dhttp.proxyPassword=1234 \
    -Dhttps.proxyProtocol=http -Dhttps.proxyHost=proxy.corp.com -Dhttps.proxyPort=8080 \
    -Dhttps.proxyUsername=alex -Dhttps.proxyPassword=1234 \
    <(echo 'println("Hello from Scala CLI")')

    Coursier or Scala CLI configuration files

    Support to be added soon

    - + \ No newline at end of file diff --git a/docs/reference/root-dir/index.html b/docs/reference/root-dir/index.html index 2cdd4af071..02adbab4a2 100644 --- a/docs/reference/root-dir/index.html +++ b/docs/reference/root-dir/index.html @@ -4,13 +4,13 @@ Project root directory | Scala CLI - +

    Project root directory

    Usage

    Scala CLI needs a root directory:

    • to write mapped sources
    • to write class files
    • for Bloop

    Setting root directory

    First of all, Scala CLI checks every passed input (in the same order in which inputs were passed) for the project.scala file:

    • If the project.scala file is passed explicitly as a source, Scala CLI sets its parent directory as the root directory.
    • If the input is a directory, Scala CLI looks for the project.scala inside this directory. If the file is found, Scala CLI sets the passed directory as the root directory.

    If more than one project.scala file is found, Scala CLI uses only the first one to set the root directory and raises a warning saying which one was used.

    If no project.scala files are found, Scala CLI sets the root directory based on the first file/directory input:

    • If the input is a directory, it is set as the root directory.
    • If the input is a file, Scala CLI sets its parent directory as the root directory.

    If more than one file/directory input has been passed Scala CLI raises the warning saying which directory has been set as the project root directory.

    If no project.scala files are found and no file/directory inputs have been passed, Scala CLI sets the current working directory (where Scala CLI was invoked from) as the project root directory.

    Example

    Let's say we have the following file structure:

    project
    │ project.scala

    └───dir1
    │ │ file1.scala
    │ │
    │ └───dir2
    │ │ project.scala
    │ │ file2.scala

    └───dir3
    │ project.scala
    │ file3.scala

    And the user runs the following command:

    project> scala-cli dir1/file1.scala dir1/dir2 dir3/project.scala

    Scala CLI will find 2 project.scala files:

    • inside dir2, since this directory was passed as an input and it has project.scala inside.
    • inside dir3, since dir3/project.scala was passed explicitly as a source

    dir1/dir2 was passed before dir3/project.scala, so dir2 will be set as the root directory for this build.

    Since more than one project.scala has been found, Scala CLI will raise the warning saying that more than one project.scala file has been found and dir1/dir2 has been set as the project root directory.

    - + \ No newline at end of file diff --git a/docs/reference/scala-command/cli-options/index.html b/docs/reference/scala-command/cli-options/index.html index 8d4a1bd8fc..3e93454054 100644 --- a/docs/reference/scala-command/cli-options/index.html +++ b/docs/reference/scala-command/cli-options/index.html @@ -4,13 +4,13 @@ Command-line options | Scala CLI - +

    Command-line options

    This document describes as scala-cli behaves if run as scala command. See more information in SIP-46

    This is a summary of options that are available for each subcommand of the scala-cli command.

    Scalac options forwarding

    All options that start with:

    • -g
    • -language
    • -opt
    • -P
    • -target
    • -V
    • -W
    • -X
    • -Y

    are assumed to be Scala compiler options and will be propagated to Scala Compiler. This applies to all commands that uses compiler directly or indirectly.

    Scalac options that are directly supported in scala CLI (so can be provided as is, without any prefixes etc.):

    • -encoding
    • -release
    • -color
    • -nowarn
    • -feature
    • -deprecation

    Compilation server options

    Available in commands:

    bsp, compile, doc, fmt , format , scalafmt, repl , console, run, setup-ide, shebang, test, uninstall

    --bloop-bsp-protocol

    IMPLEMENTATION specific per Scala Runner specification

    Protocol to use to open a BSP connection with Bloop

    --bloop-bsp-socket

    IMPLEMENTATION specific per Scala Runner specification

    Socket file to use to open a BSP connection with Bloop

    --bloop-host

    IMPLEMENTATION specific per Scala Runner specification

    Host the compilation server should bind to

    --bloop-port

    IMPLEMENTATION specific per Scala Runner specification

    Port the compilation server should bind to (pass -1 to pick a random port)

    --bloop-daemon-dir

    IMPLEMENTATION specific per Scala Runner specification

    Daemon directory of the Bloop daemon (directory with lock, pid, and socket files)

    --bloop-version

    IMPLEMENTATION specific per Scala Runner specification

    If Bloop isn't already running, the version we should start

    --bloop-bsp-timeout

    IMPLEMENTATION specific per Scala Runner specification

    Maximum duration to wait for the BSP connection to be opened

    --bloop-bsp-check-period

    IMPLEMENTATION specific per Scala Runner specification

    Duration between checks of the BSP connection state

    --bloop-startup-timeout

    IMPLEMENTATION specific per Scala Runner specification

    Maximum duration to wait for the compilation server to start up

    --bloop-default-java-opts

    IMPLEMENTATION specific per Scala Runner specification

    Include default JVM options for Bloop

    --bloop-java-opt

    IMPLEMENTATION specific per Scala Runner specification

    Pass java options to use by Bloop server

    --bloop-global-options-file

    IMPLEMENTATION specific per Scala Runner specification

    Bloop global options file

    --bloop-jvm

    IMPLEMENTATION specific per Scala Runner specification

    JVM to use to start Bloop (e.g. 'system|11', 'temurin:17', …)

    --bloop-working-dir

    IMPLEMENTATION specific per Scala Runner specification

    Working directory for Bloop, if it needs to be started

    --server

    IMPLEMENTATION specific per Scala Runner specification

    Enable / disable usage of Bloop compilation server. Bloop is used by default so use --server=false to disable it. Disabling compilation server allows to test compilation in more controlled mannter (no caching or incremental compiler) but has a detrimental effect of performance.

    Compile options

    Available in commands:

    compile

    --print-class-path

    Aliases: -p, --print-classpath

    SHOULD have per Scala Runner specification

    Print the resulting class path

    --test

    SHOULD have per Scala Runner specification

    Compile test scope

    Config options

    Available in commands:

    config

    --dump

    IMPLEMENTATION specific per Scala Runner specification

    Dump config DB as JSON

    --unset

    Aliases: --remove

    SHOULD have per Scala Runner specification

    Remove an entry from config

    --force

    Aliases: -f

    SHOULD have per Scala Runner specification

    Force overwriting values for key

    Debug options

    Available in commands:

    bsp, compile, config, doc, fmt , format , scalafmt, repl , console, run, setup-ide, shebang, test

    --debug

    SHOULD have per Scala Runner specification

    Turn debugging on

    --debug-port

    SHOULD have per Scala Runner specification

    Debug port (5005 by default)

    --debug-mode

    SHOULD have per Scala Runner specification

    Debug mode (attach by default)

    Dependency options

    Available in commands:

    bsp, compile, doc, fmt , format , scalafmt, repl , console, run, setup-ide, shebang, test

    --dependency

    Aliases: --dep

    MUST have per Scala Runner specification

    Add dependencies

    --compile-only-dependency

    Aliases: --compile-dep, --compile-lib

    MUST have per Scala Runner specification

    Add compile-only dependencies

    --repository

    Aliases: -r, --repo

    SHOULD have per Scala Runner specification

    Add repositories for dependency resolution.

    Accepts predefined repositories supported by Coursier (like sonatype:snapshots or m2Local) or a URL of the root of Maven repository

    --compiler-plugin

    Aliases: -P, --plugin

    MUST have per Scala Runner specification

    Add compiler plugin dependencies

    Doc options

    Available in commands:

    doc

    --output

    Aliases: -o

    MUST have per Scala Runner specification

    Set the destination path

    --force

    Aliases: -f

    MUST have per Scala Runner specification

    Overwrite the destination directory, if it exists

    --default-scaladoc-options

    Aliases: --default-scaladoc-opts

    SHOULD have per Scala Runner specification

    Control if Scala CLI should use default options for scaladoc, true by default. Use --default-scaladoc-opts:false to not include default options.

    Fmt options

    Available in commands:

    fmt , format , scalafmt

    --check

    SHOULD have per Scala Runner specification

    Check if sources are well formatted

    --respect-project-filters

    IMPLEMENTATION specific per Scala Runner specification

    Use project filters defined in the configuration. Turned on by default, use --respect-project-filters:false to disable it.

    --save-scalafmt-conf

    IMPLEMENTATION specific per Scala Runner specification

    Saves .scalafmt.conf file if it was created or overwritten

    --os-arch-suffix

    IMPLEMENTATION specific per Scala Runner specification

    --scalafmt-tag

    IMPLEMENTATION specific per Scala Runner specification

    --scalafmt-github-org-name

    IMPLEMENTATION specific per Scala Runner specification

    --scalafmt-extension

    IMPLEMENTATION specific per Scala Runner specification

    --scalafmt-launcher

    IMPLEMENTATION specific per Scala Runner specification

    --scalafmt-arg

    Aliases: -F

    IMPLEMENTATION specific per Scala Runner specification

    Pass an argument to scalafmt.

    --scalafmt-conf

    Aliases: --scalafmt-config

    IMPLEMENTATION specific per Scala Runner specification

    Custom path to the scalafmt configuration file.

    --scalafmt-conf-str

    Aliases: --scalafmt-conf-snippet, --scalafmt-config-str

    IMPLEMENTATION specific per Scala Runner specification

    Pass configuration as a string.

    --scalafmt-dialect

    Aliases: --dialect

    IMPLEMENTATION specific per Scala Runner specification

    Pass a global dialect for scalafmt. This overrides whatever value is configured in the .scalafmt.conf file or inferred based on Scala version used.

    --scalafmt-version

    Aliases: --fmt-version

    IMPLEMENTATION specific per Scala Runner specification

    Pass scalafmt version before running it (3.7.12 by default). If passed, this overrides whatever value is configured in the .scalafmt.conf file.

    Global suppress warning options

    Available in commands:

    bsp, clean, compile, config, doc, fmt , format , scalafmt, help, install completions , install-completions, install-home, repl , console, run, setup-ide, shebang, test, uninstall, uninstall completions , uninstall-completions, update, version

    --suppress-experimental-feature-warning

    Aliases: --suppress-experimental-warning

    IMPLEMENTATION specific per Scala Runner specification

    Suppress warnings about using experimental features

    Help options

    Available in commands:

    bsp, clean, compile, config, doc, fmt , format , scalafmt, help, install completions , install-completions, install-home, repl , console, run, setup-ide, shebang, test, uninstall, uninstall completions , uninstall-completions, update, version

    --usage

    IMPLEMENTATION specific per Scala Runner specification

    Print usage and exit

    --help

    Aliases: -h, -help

    IMPLEMENTATION specific per Scala Runner specification

    Print help message and exit

    --help-full

    Aliases: --full-help, -full-help, -help-full

    IMPLEMENTATION specific per Scala Runner specification

    Print help message, including hidden options, and exit

    Help group options

    Available in commands:

    bsp, compile, doc, fmt , format , scalafmt, repl , console, run, setup-ide, shebang, test

    --help-js

    IMPLEMENTATION specific per Scala Runner specification

    Show options for ScalaJS

    --help-native

    IMPLEMENTATION specific per Scala Runner specification

    Show options for ScalaNative

    --help-scaladoc

    Aliases: --doc-help, --help-doc, --scaladoc-help

    IMPLEMENTATION specific per Scala Runner specification

    Show options for Scaladoc

    --help-repl

    Aliases: --repl-help

    IMPLEMENTATION specific per Scala Runner specification

    Show options for Scala REPL

    --help-scalafmt

    Aliases: --fmt-help, --help-fmt, --scalafmt-help

    IMPLEMENTATION specific per Scala Runner specification

    Show options for Scalafmt

    Install completions options

    Available in commands:

    install completions , install-completions

    --format

    Aliases: --shell

    IMPLEMENTATION specific per Scala Runner specification

    Name of the shell, either zsh or bash

    --rc-file

    IMPLEMENTATION specific per Scala Runner specification

    Path to *rc file, defaults to .bashrc or .zshrc depending on shell

    --output

    Aliases: -o

    IMPLEMENTATION specific per Scala Runner specification

    Completions output directory

    --banner

    IMPLEMENTATION specific per Scala Runner specification

    Custom banner in comment placed in rc file

    --name

    IMPLEMENTATION specific per Scala Runner specification

    Custom completions name

    --env

    IMPLEMENTATION specific per Scala Runner specification

    Print completions to stdout

    Java options

    Available in commands:

    repl , console, run, shebang, test

    --java-opt

    Aliases: -J

    MUST have per Scala Runner specification

    Set Java options, such as -Xmx1g

    Java prop options

    Available in commands:

    repl , console, run, shebang, test

    --java-prop-option

    Aliases: --java-prop

    IMPLEMENTATION specific per Scala Runner specification

    Add java properties. Note that options equal -Dproperty=value are assumed to be java properties and don't require to be passed after --java-prop.

    Jvm options

    Available in commands:

    bsp, compile, config, doc, fmt , format , scalafmt, repl , console, run, setup-ide, shebang, test

    --java-home

    SHOULD have per Scala Runner specification

    Set the Java home directory

    --jvm

    Aliases: -j

    SHOULD have per Scala Runner specification

    Use a specific JVM, such as 14, adopt:11, or graalvm:21, or system

    --jvm-index

    IMPLEMENTATION specific per Scala Runner specification

    JVM index URL

    --jvm-index-os

    IMPLEMENTATION specific per Scala Runner specification

    Operating system to use when looking up in the JVM index

    --jvm-index-arch

    IMPLEMENTATION specific per Scala Runner specification

    CPU architecture to use when looking up in the JVM index

    --javac-plugin

    SHOULD have per Scala Runner specification

    Javac plugin dependencies or files

    --javac-option

    Aliases: --javac-opt

    SHOULD have per Scala Runner specification

    Javac options

    --bsp-debug-port

    IMPLEMENTATION specific per Scala Runner specification

    Port for BSP debugging

    Logging options

    Available in commands:

    bsp, clean, compile, config, doc, fmt , format , scalafmt, help, install completions , install-completions, install-home, repl , console, run, setup-ide, shebang, test, uninstall, uninstall completions , uninstall-completions, update, version

    --quiet

    Aliases: -q

    IMPLEMENTATION specific per Scala Runner specification

    Decrease logging verbosity

    --progress

    IMPLEMENTATION specific per Scala Runner specification

    Use progress bars

    Main class options

    Available in commands:

    run, shebang

    --main-class

    Aliases: -M

    MUST have per Scala Runner specification

    Specify which main class to run

    --main-class-ls

    Aliases: --list-main-class, --list-main-classes, --main-class-list

    SHOULD have per Scala Runner specification

    List main classes available in the current context

    Run options

    Available in commands:

    run, shebang

    --command

    SHOULD have per Scala Runner specification

    Print the command that would have been run (one argument per line), rather than running it

    --scratch-dir

    IMPLEMENTATION specific per Scala Runner specification

    Temporary / working directory where to write generated launchers

    --use-manifest

    IMPLEMENTATION specific per Scala Runner specification

    Run Java commands using a manifest-based class path (shortens command length)

    Scala.js options

    Available in commands:

    bsp, compile, doc, fmt , format , scalafmt, repl , console, run, setup-ide, shebang, test

    --js

    SHOULD have per Scala Runner specification

    Enable Scala.js. To show more options for Scala.js pass --help-js

    --js-version

    SHOULD have per Scala Runner specification

    The Scala.js version (1.13.2 by default).

    --js-mode

    SHOULD have per Scala Runner specification

    The Scala.js mode, either dev or release

    --js-module-kind

    SHOULD have per Scala Runner specification

    The Scala.js module kind: commonjs/common, esmodule/es, nomodule/none

    --js-check-ir

    SHOULD have per Scala Runner specification

    --js-emit-source-maps

    SHOULD have per Scala Runner specification

    Emit source maps

    --js-source-maps-path

    SHOULD have per Scala Runner specification

    Set the destination path of source maps

    --js-dom

    SHOULD have per Scala Runner specification

    Enable jsdom

    --js-header

    SHOULD have per Scala Runner specification

    A header that will be added at the top of generated .js files

    --js-allow-big-ints-for-longs

    IMPLEMENTATION specific per Scala Runner specification

    Primitive Longs may be compiled as primitive JavaScript bigints

    --js-avoid-classes

    IMPLEMENTATION specific per Scala Runner specification

    Avoid class'es when using functions and prototypes has the same observable semantics.

    --js-avoid-lets-and-consts

    IMPLEMENTATION specific per Scala Runner specification

    Avoid lets and consts when using vars has the same observable semantics.

    --js-module-split-style

    IMPLEMENTATION specific per Scala Runner specification

    The Scala.js module split style: fewestmodules, smallestmodules, smallmodulesfor

    --js-small-module-for-package

    IMPLEMENTATION specific per Scala Runner specification

    Create as many small modules as possible for the classes in the passed packages and their subpackages.

    --js-es-version

    SHOULD have per Scala Runner specification

    The Scala.js ECMA Script version: es5_1, es2015, es2016, es2017, es2018, es2019, es2020, es2021

    --js-linker-path

    IMPLEMENTATION specific per Scala Runner specification

    Path to the Scala.js linker

    --js-cli-version

    IMPLEMENTATION specific per Scala Runner specification

    Scala.js CLI version to use for linking (1.13.2 by default).

    --js-cli-java-arg

    IMPLEMENTATION specific per Scala Runner specification

    Scala.js CLI Java options

    --js-cli-on-jvm

    IMPLEMENTATION specific per Scala Runner specification

    Whether to run the Scala.js CLI on the JVM or using a native executable

    Scala Native options

    Available in commands:

    bsp, compile, doc, fmt , format , scalafmt, repl , console, run, setup-ide, shebang, test

    --native

    SHOULD have per Scala Runner specification

    Enable Scala Native. To show more options for Scala Native pass --help-native

    --native-version

    SHOULD have per Scala Runner specification

    Set the Scala Native version (0.4.14 by default).

    --native-mode

    SHOULD have per Scala Runner specification

    Set Scala Native compilation mode

    --native-lto

    SHOULD have per Scala Runner specification

    Link-time optimisation mode

    --native-gc

    SHOULD have per Scala Runner specification

    Set the Scala Native garbage collector

    --native-clang

    IMPLEMENTATION specific per Scala Runner specification

    Path to the Clang command

    --native-clangpp

    IMPLEMENTATION specific per Scala Runner specification

    Path to the Clang++ command

    --native-linking

    SHOULD have per Scala Runner specification

    Extra options passed to clang verbatim during linking

    --native-linking-defaults

    IMPLEMENTATION specific per Scala Runner specification

    Use default linking settings

    --native-compile

    SHOULD have per Scala Runner specification

    List of compile options

    --native-compile-defaults

    IMPLEMENTATION specific per Scala Runner specification

    Use default compile options

    --embed-resources

    SHOULD have per Scala Runner specification

    Embed resources into the Scala Native binary (can be read with the Java resources API)

    Scalac options

    Available in commands:

    bsp, compile, doc, fmt , format , scalafmt, repl , console, run, setup-ide, shebang, test

    --scalac-option

    Aliases: -O, --scala-opt, --scala-option

    IMPLEMENTATION specific per Scala Runner specification

    Add a scalac option. Note that options starting with -g, -language, -opt, -P, -target, -V, -W, -X, and -Y are assumed to be Scala compiler options and don't require to be passed after -O or --scalac-option.

    Scalac extra options

    Available in commands:

    bsp, compile, doc, fmt , format , scalafmt, repl , console, run, setup-ide, shebang, test

    --scalac-help

    Aliases: --help-scalac

    IMPLEMENTATION specific per Scala Runner specification

    Show help for scalac. This is an alias for --scalac-option -help

    --scalac-verbose

    Aliases: --verbose-scalac

    IMPLEMENTATION specific per Scala Runner specification

    Turn verbosity on for scalac. This is an alias for --scalac-option -verbose

    Shared options

    Available in commands:

    bsp, compile, doc, fmt , format , scalafmt, repl , console, run, setup-ide, shebang, test

    --scala-version

    Aliases: -S, --scala

    MUST have per Scala Runner specification

    Set the Scala version (3.3.0 by default)

    --scala-binary-version

    Aliases: -B, --scala-bin, --scala-binary

    MUST have per Scala Runner specification

    Set the Scala binary version

    --extra-jars

    Aliases: --class, --class-path, --classes, -classpath, --classpath, -cp, --extra-class, --extra-class-path, --extra-classes, --extra-jar, --jar, --jars

    MUST have per Scala Runner specification

    Add extra JARs and compiled classes to the class path

    --extra-compile-only-jars

    Aliases: --compile-only-jar, --compile-only-jars, --extra-compile-only-jar

    SHOULD have per Scala Runner specification

    Add extra JARs in the compilaion class path. Mainly using to run code in managed environments like Spark not to include certain depenencies on runtime ClassPath.

    --extra-source-jars

    Aliases: --extra-source-jar, --source-jar, --source-jars

    SHOULD have per Scala Runner specification

    Add extra source JARs

    --resource-dirs

    Aliases: --resource-dir

    MUST have per Scala Runner specification

    Add a resource directory

    --platform

    SHOULD have per Scala Runner specification

    Specify platform

    --scala-library

    IMPLEMENTATION specific per Scala Runner specification

    --with-compiler

    Aliases: -with-compiler, --with-scala-compiler

    MUST have per Scala Runner specification

    Allows to include the Scala compiler artifacts on the classpath.

    --java

    IMPLEMENTATION specific per Scala Runner specification

    Do not add dependency to Scala Standard library. This is useful, when Scala CLI works with pure Java projects.

    --runner

    IMPLEMENTATION specific per Scala Runner specification

    Should include Scala CLI runner on the runtime ClassPath. Runner is added by default for application running on JVM using standard Scala versions. Runner is used to make stack traces more readable in case of application failure.

    --semantic-db

    SHOULD have per Scala Runner specification

    Generate SemanticDBs

    --strict-bloop-json-check

    IMPLEMENTATION specific per Scala Runner specification

    --compilation-output

    Aliases: --compile-out, --compile-output, -d, --destination, --output-directory

    MUST have per Scala Runner specification

    Copy compilation results to output directory using either relative or absolute path

    --with-toolkit

    Aliases: --toolkit

    IMPLEMENTATION specific per Scala Runner specification

    Add toolkit to classPath

    --exclude

    IMPLEMENTATION specific per Scala Runner specification

    Exclude sources

    Snippet options

    Available in commands:

    bsp, compile, doc, fmt , format , scalafmt, repl , console, run, setup-ide, shebang, test

    --script-snippet

    SHOULD have per Scala Runner specification

    Allows to execute a passed string as a Scala script

    --execute-script

    Aliases: -e, --execute-sc, --execute-scala-script

    SHOULD have per Scala Runner specification

    A synonym to --script-snippet, which defaults the sub-command to run when no sub-command is passed explicitly

    --scala-snippet

    SHOULD have per Scala Runner specification

    Allows to execute a passed string as Scala code

    --execute-scala

    IMPLEMENTATION specific per Scala Runner specification

    A synonym to --scala-snippet, which defaults the sub-command to run when no sub-command is passed explicitly

    --java-snippet

    IMPLEMENTATION specific per Scala Runner specification

    Allows to execute a passed string as Java code

    --execute-java

    IMPLEMENTATION specific per Scala Runner specification

    A synonym to --scala-snippet, which defaults the sub-command to run when no sub-command is passed explicitly

    Suppress warning options

    Available in commands:

    bsp, compile, doc, fmt , format , scalafmt, repl , console, run, setup-ide, shebang, test

    --suppress-directives-in-multiple-files-warning

    Aliases: --suppress-warning-directives-in-multiple-files

    IMPLEMENTATION specific per Scala Runner specification

    Suppress warnings about using directives in multiple files

    --suppress-outdated-dependency-warning

    IMPLEMENTATION specific per Scala Runner specification

    Suppress warnings about outdated dependencies in project

    Test options

    Available in commands:

    test

    --test-framework

    SHOULD have per Scala Runner specification

    Name of the test framework's runner class to use while running tests

    --require-tests

    SHOULD have per Scala Runner specification

    Fail if no test suites were run

    --test-only

    SHOULD have per Scala Runner specification

    Specify a glob pattern to filter the tests suite to be run.

    Uninstall options

    Available in commands:

    uninstall

    --force

    Aliases: -f

    IMPLEMENTATION specific per Scala Runner specification

    Force scala-cli uninstall

    --skip-cache

    IMPLEMENTATION specific per Scala Runner specification

    Don't clear Scala CLI cache

    --binary-name

    IMPLEMENTATION specific per Scala Runner specification

    Binary name

    --bin-dir

    IMPLEMENTATION specific per Scala Runner specification

    Binary directory

    Uninstall completions options

    Available in commands:

    uninstall, uninstall completions , uninstall-completions

    --rc-file

    IMPLEMENTATION specific per Scala Runner specification

    Path to *rc file, defaults to .bashrc or .zshrc depending on shell

    --banner

    IMPLEMENTATION specific per Scala Runner specification

    Custom banner in comment placed in rc file

    --name

    IMPLEMENTATION specific per Scala Runner specification

    Custom completions name

    Update options

    Available in commands:

    update

    --binary-name

    IMPLEMENTATION specific per Scala Runner specification

    Binary name

    --bin-dir

    IMPLEMENTATION specific per Scala Runner specification

    Binary directory

    --force

    Aliases: -f

    IMPLEMENTATION specific per Scala Runner specification

    Force update Scala CLI if it is outdated

    --is-internal-run

    IMPLEMENTATION specific per Scala Runner specification

    --gh-token

    IMPLEMENTATION specific per Scala Runner specification

    A github token used to access GitHub. Not needed in most cases.

    Verbosity options

    Available in commands:

    bsp, clean, compile, config, doc, fmt , format , scalafmt, help, install completions , install-completions, install-home, repl , console, run, setup-ide, shebang, test, uninstall, uninstall completions , uninstall-completions, update, version

    --verbose

    Aliases: -v, -verbose

    IMPLEMENTATION specific per Scala Runner specification

    Increase verbosity (can be specified multiple times)

    --interactive

    Aliases: -i

    IMPLEMENTATION specific per Scala Runner specification

    Interactive mode

    --actions

    IMPLEMENTATION specific per Scala Runner specification

    Enable actionable diagnostics

    Version options

    Available in commands:

    bsp, compile, doc, fmt , format , scalafmt, repl , console, run, setup-ide, shebang, test, version

    --cli-version

    Aliases: --cli

    IMPLEMENTATION specific per Scala Runner specification

    Show plain Scala CLI version only

    --scala-version

    Aliases: --scala

    IMPLEMENTATION specific per Scala Runner specification

    Show plain Scala version only

    --gh-token

    IMPLEMENTATION specific per Scala Runner specification

    A github token used to access GitHub. Not needed in most cases.

    --offline

    IMPLEMENTATION specific per Scala Runner specification

    Don't check for the newest available Scala CLI version upstream

    Watch options

    Available in commands:

    compile, repl , console, run, shebang, test

    --watch

    Aliases: -w

    SHOULD have per Scala Runner specification

    Run the application in the background, automatically wake the thread and re-run if sources have been changed

    --restart

    Aliases: --revolver

    SHOULD have per Scala Runner specification

    Run the application in the background, automatically kill the process and restart if sources have been changed

    Internal options

    Bsp options

    Available in commands:

    bsp

    --json-options

    IMPLEMENTATION specific per Scala Runner specification

    Command-line options JSON file

    Bsp file options

    Available in commands:

    clean, setup-ide

    --bsp-directory

    Aliases: --bsp-dir

    IMPLEMENTATION specific per Scala Runner specification

    Custom BSP configuration location

    --bsp-name

    Aliases: --name

    IMPLEMENTATION specific per Scala Runner specification

    Name of BSP

    Coursier options

    Available in commands:

    bsp, compile, config, doc, fmt , format , scalafmt, repl , console, run, setup-ide, shebang, test, uninstall

    --ttl

    IMPLEMENTATION specific per Scala Runner specification

    Specify a TTL for changing dependencies, such as snapshots

    --cache

    IMPLEMENTATION specific per Scala Runner specification

    Set the coursier cache location

    --coursier-validate-checksums

    IMPLEMENTATION specific per Scala Runner specification

    Enable checksum validation of artifacts downloaded by coursier

    Input options

    Available in commands:

    bsp, compile, doc, fmt , format , scalafmt, repl , console, run, setup-ide, shebang, test

    --default-forbidden-directories

    IMPLEMENTATION specific per Scala Runner specification

    --forbid

    IMPLEMENTATION specific per Scala Runner specification

    Install home options

    Available in commands:

    install-home

    --scala-cli-binary-path

    IMPLEMENTATION specific per Scala Runner specification

    --force

    Aliases: -f

    IMPLEMENTATION specific per Scala Runner specification

    Overwrite if it exists

    --binary-name

    IMPLEMENTATION specific per Scala Runner specification

    Binary name

    --env

    IMPLEMENTATION specific per Scala Runner specification

    Print the update to env variable

    --bin-dir

    IMPLEMENTATION specific per Scala Runner specification

    Binary directory

    Repl options

    Available in commands:

    repl , console

    --repl-dry-run

    IMPLEMENTATION specific per Scala Runner specification

    Don't actually run the REPL, just fetch it

    Setup IDE options

    Available in commands:

    setup-ide

    --charset

    IMPLEMENTATION specific per Scala Runner specification

    Workspace options

    Available in commands:

    bsp, clean, compile, doc, fmt , format , scalafmt, repl , console, run, setup-ide, shebang, test

    --workspace

    IMPLEMENTATION specific per Scala Runner specification

    Directory where .scala-build is written

    - + \ No newline at end of file diff --git a/docs/reference/scala-command/commands/index.html b/docs/reference/scala-command/commands/index.html index eaa0a7472e..f0c323c042 100644 --- a/docs/reference/scala-command/commands/index.html +++ b/docs/reference/scala-command/commands/index.html @@ -4,7 +4,7 @@ Commands | Scala CLI - + @@ -62,7 +62,7 @@ For detailed installation instructions refer to our website: https://scala-cli.virtuslab.org/install

    Accepts option groups: compilation server, coursier, global suppress warning, logging, uninstall, uninstall completions, verbosity

    uninstall completions

    Aliases: uninstall-completions

    Uninstalls Scala CLI completions from your shell.

    For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/completions

    Accepts option groups: global suppress warning, logging, uninstall completions, verbosity

    update

    Updates Scala CLI. Works only when installed with the installation script. If Scala CLI was installed with an external tool, refer to its update methods.

    For detailed installation instructions refer to our website: https://scala-cli.virtuslab.org/install

    Accepts option groups: global suppress warning, logging, update, verbosity

    - + \ No newline at end of file diff --git a/docs/reference/scala-command/directives/index.html b/docs/reference/scala-command/directives/index.html index 941b81c35f..7117289225 100644 --- a/docs/reference/scala-command/directives/index.html +++ b/docs/reference/scala-command/directives/index.html @@ -4,7 +4,7 @@ Directives | Scala CLI - + @@ -13,7 +13,7 @@ For now it uses documentation specific to Scala CLI but at some point it may be refactored to provide more abstract documentation. Documentation is split into sections in the spirit of RFC keywords (MUST, SHOULD).

    MUST have directives:

    Compiler options

    Add Scala compiler options

    //> using option option

    //> using options option1, option2

    Examples

    //> using option -Xasync

    //> using test.option -Xasync

    //> using options -Xasync, -Xfatal-warnings

    Compiler plugins

    Adds compiler plugins

    using plugin org:name:ver

    Examples

    //> using plugin org.typelevel:::kind-projector:0.13.2

    Dependency

    Add dependencies

    //> using dep org:name:ver

    Examples

    //> using dep com.lihaoyi::os-lib:0.9.1

    //> using test.dep org.scalatest::scalatest:3.2.10

    //> using test.dep org.scalameta::munit:0.7.29

    //> using dep tabby:tabby:0.2.3,url=https://github.com/bjornregnell/tabby/releases/download/v0.2.3/tabby_3-0.2.3.jar

    Java options

    Add Java options which will be passed when running an application.

    //> using javaOpt options

    Examples

    //> using javaOpt -Xmx2g, -Dsomething=a

    //> using test.javaOpt -Dsomething=a

    Java properties

    Add Java properties

    //> using javaProp key=value //> using javaProp key

    Examples

    //> using javaProp foo1=bar, foo2

    //> using test.javaProp foo3=bar foo4

    Main class

    Specify default main class

    //> using mainClass main class

    Examples

    //> using mainClass helloWorld

    Scala version

    Set the default Scala version

    //> using scala version+

    Examples

    //> using scala 3.0.2

    //> using scala 2.13

    //> using scala 2

    //> using scala 2.13.6, 2.12.16

    SHOULD have directives:

    Custom JAR

    Manually add JAR(s) to the class path

    //> using jar path

    //> using jars path1 path2

    Examples

    //> using jar /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/chuusai/shapeless_2.13/2.3.7/shapeless_2.13-2.3.7.jar

    //> using test.jar /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/chuusai/shapeless_2.13/2.3.7/shapeless_2.13-2.3.7.jar

    //> using sourceJar /path/to/custom-jar-sources.jar

    //> using sourceJars /path/to/custom-jar-sources.jar /path/to/another-jar-sources.jar

    //> using test.sourceJar /path/to/test-custom-jar-sources.jar

    Custom sources

    Manually add sources to the project

    //> using file hello.sc

    //> using files Utils.scala, Helper.scala …

    Examples

    //> using file utils.scala

    Exclude sources

    Exclude sources from the project

    //> using exclude "*.sc"

    //> using exclude "examples/*" "*/resources/*" …

    Examples

    //> using exclude utils.scala

    JVM version

    Use a specific JVM, such as 14, adopt:11, or graalvm:21, or system

    //> using jvm value

    Examples

    //> using jvm 11

    //> using jvm adopt:11

    //> using jvm graalvm:21

    Java home

    Sets Java home used to run your application or tests

    //> using javaHome path

    Examples

    //> using javaHome /Users/Me/jdks/11

    Javac options

    Add Javac options which will be passed when compiling sources.

    //> using javacOpt options

    Examples

    //> using javacOpt -source 1.8 -target 1.8

    //> using test.javacOpt -source 1.8 -target 1.8

    Platform

    Set the default platform to Scala.js or Scala Native

    //> using platform (jvm|scala-js|js|scala-native|native)+

    Examples

    //> using platform scala-js

    //> using platform jvm scala-native

    Repository

    Add repositories for dependency resolution.

    Accepts predefined repositories supported by Coursier (like sonatype:snapshots or m2Local) or a URL of the root of Maven repository

    //> using repository repository

    Examples

    //> using repository jitpack

    //> using repository sonatype:snapshots

    //> using repository m2Local

    //> using repository https://maven-central.storage-download.googleapis.com/maven2

    Resource directories

    Manually add a resource directory to the class path

    //> using resourceDir path

    //> using resourceDirs path1 path2

    Examples

    //> using resourceDir ./resources

    //> using test.resourceDir ./resources

    Scala Native options

    Add Scala Native options

    //> using nativeGc value

    //> using nativeMode value

    //> using nativeLto value

    //> using nativeVersion value

    //> using nativeCompile value1 value2

    //> using nativeLinking value1 value2

    //> using nativeClang value

    //> using nativeClangPP value

    //> using nativeEmbedResources true|false

    Examples

    //> using nativeVersion 0.4.0

    Scala.js options

    Add Scala.js options

    //> using jsVersion value

    //> using jsMode value

    //> using jsModuleKind value

    //> using jsSmallModuleForPackage value1 value2

    //> using jsCheckIr true|false

    //> using jsEmitSourceMaps true|false

    //> using jsDom true|false

    //> using jsHeader value

    //> using jsAllowBigIntsForLongs true|false

    //> using jsAvoidClasses true|false

    //> using jsAvoidLetsAndConsts true|false

    //> using jsModuleSplitStyleStr value

    //> using jsEsVersionStr value

    Examples

    //> using jsModuleKind common

    Test framework

    Set the test framework

    //> using testFramework class_name

    Examples

    //> using testFramework utest.runner.Framework

    Toolkit

    Use a toolkit as dependency

    //> using toolkit version

    Examples

    //> using toolkit 0.1.0

    //> using toolkit latest

    //> using test.toolkit latest

    - + \ No newline at end of file diff --git a/docs/reference/scala-command/index.html b/docs/reference/scala-command/index.html index 5b8406ea63..2b1315408d 100644 --- a/docs/reference/scala-command/index.html +++ b/docs/reference/scala-command/index.html @@ -4,7 +4,7 @@ Scala CLI as scala | Scala CLI - + @@ -17,7 +17,7 @@ globally running:

    scala-cli config power true

    To check which options, commands and directives are supported when running Scala CLI with limited functionalities, refer to options, commands and using directives, respectively.

    Testing Scala CLI as scala

    There are two recommended ways to test and use Scala CLI:

    • with brew:
    brew install virtuslab/scala-experimental/scala
    • with coursier:
    cs setup
    cs install scala-experimental ← this command will replace the default scala runner

    Alternatively, you can rename your scala-cli executable or alias it as scala.

    Migrating from the old scala runner to Scala CLI

    If you have been using the old scala runner and want to migrate to Scala CLI, refer to the migration guide.

    - + \ No newline at end of file diff --git a/docs/reference/scala-command/runner-specification/index.html b/docs/reference/scala-command/runner-specification/index.html index 77e290d6db..fa78e0f759 100644 --- a/docs/reference/scala-command/runner-specification/index.html +++ b/docs/reference/scala-command/runner-specification/index.html @@ -4,7 +4,7 @@ Scala Runner specification | Scala CLI - + @@ -61,7 +61,7 @@ For detailed installation instructions refer to our website: https://scala-cli.virtuslab.org/install

    Implementantation specific options

    --usage

    Print usage and exit

    --help

    Print help message and exit

    Aliases: -h ,-help

    --help-full

    Print help message, including hidden options, and exit

    Aliases: --full-help ,-help-full ,-full-help

    --verbose

    Increase verbosity (can be specified multiple times)

    Aliases: -v ,-verbose

    --interactive

    Interactive mode

    Aliases: -i

    --actions

    Enable actionable diagnostics

    --quiet

    Decrease logging verbosity

    Aliases: -q

    --progress

    Use progress bars

    --suppress-experimental-feature-warning

    Suppress warnings about using experimental features

    Aliases: --suppress-experimental-warning

    --bloop-bsp-protocol

    Protocol to use to open a BSP connection with Bloop

    --bloop-bsp-socket

    Socket file to use to open a BSP connection with Bloop

    --bloop-host

    Host the compilation server should bind to

    --bloop-port

    Port the compilation server should bind to (pass -1 to pick a random port)

    --bloop-daemon-dir

    Daemon directory of the Bloop daemon (directory with lock, pid, and socket files)

    --bloop-version

    If Bloop isn't already running, the version we should start

    --bloop-bsp-timeout

    Maximum duration to wait for the BSP connection to be opened

    --bloop-bsp-check-period

    Duration between checks of the BSP connection state

    --bloop-startup-timeout

    Maximum duration to wait for the compilation server to start up

    --bloop-default-java-opts

    Include default JVM options for Bloop

    --bloop-java-opt

    Pass java options to use by Bloop server

    --bloop-global-options-file

    Bloop global options file

    --bloop-jvm

    JVM to use to start Bloop (e.g. 'system|11', 'temurin:17', …)

    --bloop-working-dir

    Working directory for Bloop, if it needs to be started

    --server

    Enable / disable usage of Bloop compilation server. Bloop is used by default so use --server=false to disable it. Disabling compilation server allows to test compilation in more controlled mannter (no caching or incremental compiler) but has a detrimental effect of performance.

    --ttl

    Specify a TTL for changing dependencies, such as snapshots

    --cache

    Set the coursier cache location

    --coursier-validate-checksums

    Enable checksum validation of artifacts downloaded by coursier

    --rc-file

    Path to *rc file, defaults to .bashrc or .zshrc depending on shell

    --banner

    Custom banner in comment placed in rc file

    --name

    Custom completions name

    --force

    Force scala-cli uninstall

    Aliases: -f

    --skip-cache

    Don't clear Scala CLI cache

    --binary-name

    Binary name

    --bin-dir

    Binary directory


    uninstall-completions command

    IMPLEMENTATION specific for Scala Runner specification.

    Aliases: uninstall-completions

    Uninstalls Scala CLI completions from your shell.

    For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/completions

    Implementantation specific options

    --usage

    Print usage and exit

    --help

    Print help message and exit

    Aliases: -h ,-help

    --help-full

    Print help message, including hidden options, and exit

    Aliases: --full-help ,-help-full ,-full-help

    --rc-file

    Path to *rc file, defaults to .bashrc or .zshrc depending on shell

    --banner

    Custom banner in comment placed in rc file

    --name

    Custom completions name

    --verbose

    Increase verbosity (can be specified multiple times)

    Aliases: -v ,-verbose

    --interactive

    Interactive mode

    Aliases: -i

    --actions

    Enable actionable diagnostics

    --quiet

    Decrease logging verbosity

    Aliases: -q

    --progress

    Use progress bars

    --suppress-experimental-feature-warning

    Suppress warnings about using experimental features

    Aliases: --suppress-experimental-warning


    update command

    IMPLEMENTATION specific for Scala Runner specification.

    Updates Scala CLI. Works only when installed with the installation script. If Scala CLI was installed with an external tool, refer to its update methods.

    For detailed installation instructions refer to our website: https://scala-cli.virtuslab.org/install

    Implementantation specific options

    --usage

    Print usage and exit

    --help

    Print help message and exit

    Aliases: -h ,-help

    --help-full

    Print help message, including hidden options, and exit

    Aliases: --full-help ,-help-full ,-full-help

    --verbose

    Increase verbosity (can be specified multiple times)

    Aliases: -v ,-verbose

    --interactive

    Interactive mode

    Aliases: -i

    --actions

    Enable actionable diagnostics

    --quiet

    Decrease logging verbosity

    Aliases: -q

    --progress

    Use progress bars

    --suppress-experimental-feature-warning

    Suppress warnings about using experimental features

    Aliases: --suppress-experimental-warning

    --binary-name

    Binary name

    --bin-dir

    Binary directory

    --force

    Force update Scala CLI if it is outdated

    Aliases: -f

    --is-internal-run

    --gh-token

    A github token used to access GitHub. Not needed in most cases.


    - + \ No newline at end of file diff --git a/docs/reference/scala-versions/index.html b/docs/reference/scala-versions/index.html index c0d2b4e029..259f122d8f 100644 --- a/docs/reference/scala-versions/index.html +++ b/docs/reference/scala-versions/index.html @@ -4,7 +4,7 @@ Supported scala versions | Scala CLI - + @@ -12,7 +12,7 @@

    Supported scala versions

    Currently, Scala CLI supports Scala 3, 2.13 and 2.12. The table below lists the last supported version of Scala in Scala CLI. If you want to use a newer Scala version, it is recommended to update scala-cli.

    Scala CLI versionsScala 3Scala 2.13Scala 2.12
    0.0.93.0.22.13.72.12.7
    0.1.0 - 0.1.33.1.12.13.82.12.15
    0.1.4 - 0.1.73.1.22.13.82.12.15
    0.1.83.1.22.13.82.12.16
    0.1.9 - 0.1.123.1.32.13.82.12.16
    0.1.13 - 0.1.153.2.02.13.82.12.16
    0.1.16 - 0.1.173.2.02.13.102.12.17
    0.1.18 - 0.1.193.2.12.13.102.12.17
    0.1.20 - 1.0.0-RC23.2.22.13.102.12.17
    1.0.0 - 1.0.13.3.02.13.102.12.17
    1.0.1 - current3.3.02.13.112.12.18
    - + \ No newline at end of file diff --git a/docs/release_notes/index.html b/docs/release_notes/index.html index f227fe6401..824ea9032f 100644 --- a/docs/release_notes/index.html +++ b/docs/release_notes/index.html @@ -4,7 +4,7 @@ Release notes | Scala CLI - + @@ -237,7 +237,7 @@ in #1076
  • Tweaking by alexarchambault in #1087
  • Full Changelog: https://github.com/VirtusLab/scala-cli/compare/v0.1.7...v0.1.8

    Older versions

    The release notes for all the past versions of Scala CLI can be viewed on our releases page on GitHub.

    - + \ No newline at end of file diff --git a/docs/under-the-hood/index.html b/docs/under-the-hood/index.html index 3439680b4a..fa64cee2d3 100644 --- a/docs/under-the-hood/index.html +++ b/docs/under-the-hood/index.html @@ -4,7 +4,7 @@ Under the hood | Scala CLI - + @@ -27,7 +27,7 @@ The example below shows how to set the Java properties -Djavax.net.ssl.trustStore=cacerts and -Dfoo=bar2:

    scala-cli config java.properties Djavax.net.ssl.trustStore=cacerts Dfoo=bar2
    note

    Please note that if you need to modify the Java properties, you have to redefine all of them. It's not possible to update just a single value via the config command. Each update effectively replaces the entire Java properties list.

    - + \ No newline at end of file diff --git a/education/index.html b/education/index.html index 3038aca4d6..2ea598aab8 100644 --- a/education/index.html +++ b/education/index.html @@ -4,13 +4,13 @@ Education with Scala CLI | Scala CLI - +

    Learn a language not a build tool

    Scala CLI is designed in a way so you can focus on learning, not struggle with installation or build tool.

    gifs/education.gifgifs/education.gif

    Education with Scala CLI

    Complete installation

    Scala CLI comes with batteries included. No additional installation is required, no more fluffing with setting up the correct Java version or PATH

    Scala CLI manages JVMs, Scala and other used tools under the hood.

    gifs/complete-install.gifgifs/complete-install.gif

    Solid defaults

    No additional configuration is needed to most Scala CLI commands.

    Scala CLI is configured out of the box to use the latest stable versions and other commands such as formatter or compiler contain reasonable defaults.

    gifs/defaults.gifgifs/defaults.gif

    No learning curve

    Scala CLI does not use complex configuration language, its options are simple and self-explanatory

    There are no big differences in running repl or .scala files so expanding the results of repl session into a small project does not require learning new concepts from Scala CLI perspective

    gifs/learning_curve.gifgifs/learning_curve.gif
    - + \ No newline at end of file diff --git a/index.html b/index.html index 04fcc6a006..4b842e6a7f 100644 --- a/index.html +++ b/index.html @@ -4,13 +4,13 @@ Scala CLI | Scala CLI - +

    Scala CLI is a command-line tool to interact with the Scala language.

    It lets you compile, run, test, and package your Scala code (and more!)

    gifs/demo.gifgifs/demo.gif
    >_ Why Scala CLI?

    Scala CLI combines all the features you need to learn and use Scala in your scripts, playgrounds and (single-module) projects.

    To get started you can read the documentation, or just install and enjoy scala-cli.

    Scala CLI will soon become the default Scala runner and will be shipped as `scala` (read more).

    Intuitive, simple
    Intuitive, simple
    No complicated mechanisms, tasks, plugins or extensions: just a single-module. All our commands have multiple aliases and follow well-known conventions.
    Fast
    Fast
    Scala CLI is optimized to be as fast as possible. CLI is compiled to native code and compilations are offloaded to bloop.
    Command-line first
    Command-line first
    Scala CLI does not require a configuration file, and all in-file configurations can be overridden by command-line. No additional installation or setup of an environment (such as a specific working directory) are required.

    Install Scala CLI

    Still undecided?

    Here come our main features

    Scala versions, dependencies and JVMs

    Scala CLI is built on top of coursier
    This allow us to manage Scala versions, dependencies and JVMs so you can test your code in different environments by changing single option.

    Scala CLI ships with all its dependencies
    No need to fluff with installing JVM or setting up PATH.

    Some additional setup may be required for JS and Native

    gifs/versions.gifgifs/versions.gif

    Universal tool

    If you want to use older version of Scala or run your code in JS or Native environments we've got you covered.

    Switching between platforms or Scala versions is as easy as changing a parameter.

    Some additional setup may be required for JS and Native

    gifs/universal_tool.gifgifs/universal_tool.gif

    We do not call Scala CLI a build tool

    Scala CLI shares some similarities with build tools, but doesn't aim at supporting multi-module projects, nor to be extended via a task system known from sbt, mill or bazel.

    Scala ecosystem has multiple amazing build tools, there is no need to create another multipurpose build tool.

    buildtools.pngbuildtools.png

    Complete installation

    Scala CLI comes with batteries included. No additional installation is required, no more fluffing with setting up the correct Java version or PATH

    Scala CLI manages JVMs, Scala and other used tools under the hood.

    gifs/complete-install.gifgifs/complete-install.gif

    Solid defaults

    No additional configuration is needed to most Scala CLI commands.

    Scala CLI is configured out of the box to use the latest stable versions and other commands such as formatter or compiler contain reasonable defaults.

    gifs/defaults.gifgifs/defaults.gif

    No learning curve

    Scala CLI does not use complex configuration language, its options are simple and self-explanatory

    There are no big differences in running repl or .scala files so expanding the results of repl session into a small project does not require learning new concepts from Scala CLI perspective

    gifs/learning_curve.gifgifs/learning_curve.gif

    Scripts are as powerful as other programs

    Scripts in Scala CLI can use dependencies and other features as standard Scala programs. Scala CLI is command-line first giving access to all its features without need for any configuration file or specific project structure.

    gifs/powerful_scripts.gifgifs/powerful_scripts.gif

    Embeddable Scripts

    Scala CLI can be set up in shebang lines, making your *.scala or *.sc files runnable

    Scala CLI supports piping inputs and is designed to be embeddable in other scripts, turning Scala into proper scripting language

    gifs/embeddable_scripts.gifgifs/embeddable_scripts.gif

    Self-contained examples

    With Scala CLI, configuration can be included in source code so complex examples can be self-contained and shipped as e.g. gist. Moreover, Scala CLI can compile, run and test gists without any manual work!

    Scala CLI is a perfect tool to submit and reproduce bugs

    gifs/self-contained-examples.gifgifs/self-contained-examples.gif
    - + \ No newline at end of file diff --git a/install/index.html b/install/index.html index 112a038ace..10954356c2 100644 --- a/install/index.html +++ b/install/index.html @@ -4,7 +4,7 @@ Install Scala CLI | Scala CLI - + @@ -88,7 +88,7 @@

    If you have installed Scala CLI completions into your shell, uninstall command uninstalls them by running uninstall-completions command under the hood.

    - + \ No newline at end of file diff --git a/markdown-page/index.html b/markdown-page/index.html index 2b88c1d66e..f4da42b5a2 100644 --- a/markdown-page/index.html +++ b/markdown-page/index.html @@ -4,13 +4,13 @@ Markdown page example | Scala CLI - +

    Markdown page example

    You don't need React to write simple standalone pages.

    - + \ No newline at end of file diff --git a/projects/index.html b/projects/index.html index 2e12fdeeaa..b18b476027 100644 --- a/projects/index.html +++ b/projects/index.html @@ -4,13 +4,13 @@ Single-module projects with Scala CLI | Scala CLI - +

    Fight with your bugs, not with your buildtool

    Scala CLI provides all the functionality to easily maintain single module projects like cli apps or simple microservices.

    gifs/projects.gifgifs/projects.gif

    Single-module projects with Scala CLI

    Scala versions, dependencies and JVMs

    Scala CLI is built on top of coursier
    This allow us to manage Scala versions, dependencies and JVMs so you can test your code in different environments by changing single option.

    Scala CLI ships with all its dependencies
    No need to fluff with installing JVM or setting up PATH.

    Some additional setup may be required for JS and Native

    gifs/versions.gifgifs/versions.gif

    Universal tool

    If you want to use older version of Scala or run your code in JS or Native environments we've got you covered.

    Switching between platforms or Scala versions is as easy as changing a parameter.

    Some additional setup may be required for JS and Native

    gifs/universal_tool.gifgifs/universal_tool.gif

    We do not call Scala CLI a build tool

    Scala CLI shares some similarities with build tools, but doesn't aim at supporting multi-module projects, nor to be extended via a task system known from sbt, mill or bazel.

    Scala ecosystem has multiple amazing build tools, there is no need to create another multipurpose build tool.

    buildtools.pngbuildtools.png
    - + \ No newline at end of file diff --git a/prototyping/index.html b/prototyping/index.html index 8187dbe7d6..899c80803b 100644 --- a/prototyping/index.html +++ b/prototyping/index.html @@ -4,13 +4,13 @@ Prototyping, experimenting, reproducing bugs with Scala CLI | Scala CLI - +

    Move fast and break things but be in control of your build

    Have you ever wasted time prototyping, experimenting or reproducing a nasty bug by testing in a different environment than you intended?

    With Scala CLI you can explicitly define Scala or JVM versions, platform, compiler options and dependencies by setting them as arguments.

    gifs/prototyping.gifgifs/prototyping.gif

    Prototyping, experimenting, reproducing bugs with Scala CLI

    Self-contained examples

    With Scala CLI, configuration can be included in source code so complex examples can be self-contained and shipped as e.g. gist. Moreover, Scala CLI can compile, run and test gists without any manual work!

    Scala CLI is a perfect tool to submit and reproduce bugs

    gifs/self-contained-examples.gifgifs/self-contained-examples.gif
    - + \ No newline at end of file diff --git a/scripting/index.html b/scripting/index.html index 7aaaf5be11..0ee2cc0382 100644 --- a/scripting/index.html +++ b/scripting/index.html @@ -4,13 +4,13 @@ Scripting with Scala CLI | Scala CLI - +

    Scripting using all the powers of the Scala ecosystem

    Scala CLI allows you to use Scala to create and enhance scripts with using all the goodies of Scala.

    Use dependencies, declare tests or even package your scripts into native applications!

    gifs/scripting.gifgifs/scripting.gif

    Scripting with Scala CLI

    Scripts are as powerful as other programs

    Scripts in Scala CLI can use dependencies and other features as standard Scala programs. Scala CLI is command-line first giving access to all its features without need for any configuration file or specific project structure.

    gifs/powerful_scripts.gifgifs/powerful_scripts.gif

    Embeddable Scripts

    Scala CLI can be set up in shebang lines, making your *.scala or *.sc files runnable

    Scala CLI supports piping inputs and is designed to be embeddable in other scripts, turning Scala into proper scripting language

    gifs/embeddable_scripts.gifgifs/embeddable_scripts.gif
    - + \ No newline at end of file diff --git a/search/index.html b/search/index.html index b939854fd9..42bd9a60ae 100644 --- a/search/index.html +++ b/search/index.html @@ -4,13 +4,13 @@ Search the documentation | Scala CLI - + - + \ No newline at end of file diff --git a/spark/index.html b/spark/index.html index 9344de1c9c..93124de15f 100644 --- a/spark/index.html +++ b/spark/index.html @@ -4,7 +4,7 @@ Experimental Spark features | Scala CLI - + @@ -13,7 +13,7 @@ to spark-submit, and optimized for it.

    SparkJob.scala
    //> using dep org.apache.spark::spark-sql:3.0.3
    //> using scala 2.12.15

    import org.apache.spark._
    import org.apache.spark.sql._

    object SparkJob {
    def main(args: Array[String]): Unit = {
    val spark = SparkSession.builder()
    .appName("Test job")
    .getOrCreate()
    import spark.implicits._
    def sc = spark.sparkContext
    val accum = sc.longAccumulator
    sc.parallelize(1 to 10).foreach(x => accum.add(x))
    println("Result: " + accum.value)
    }
    }
    scala-cli --power package --spark SparkJob.scala -o spark-job.jar
    Compiling project (Scala 2.12.15, JVM)
    Compiled project (Scala 2.12.15, JVM)
    Wrote spark-job.jar
    spark-submit spark-job.jar

    Result: 55

    Running Spark jobs

    The run sub-command can run Spark jobs, when passed --spark:

    scala-cli run --spark SparkJob.scala # same example as above

    Note that this requires either

    • spark-submit to be in available in PATH
    • SPARK_HOME to be set in the environment

    Running Spark jobs in a standalone way

    The run sub-command can not only run Spark jobs, but it can also work without a Spark distribution. For that to work, it downloads Spark JARs, and calls the main class of spark-submit itself via these JARs:

    scala-cli run --spark-standalone SparkJob.scala # same example as above

    Running Hadoop jobs

    The run sub-command can run Hadoop jobs, by calling the hadoop jar command under-the-hood:

    WordCount.java
    //> using dep org.apache.hadoop:hadoop-client-api:3.3.3

    // from https://hadoop.apache.org/docs/r3.3.3/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html

    import java.io.IOException;
    import java.util.StringTokenizer;

    import org.apache.hadoop.conf.Configuration;
    import org.apache.hadoop.fs.Path;
    import org.apache.hadoop.io.IntWritable;
    import org.apache.hadoop.io.Text;
    import org.apache.hadoop.mapreduce.Job;
    import org.apache.hadoop.mapreduce.Mapper;
    import org.apache.hadoop.mapreduce.Reducer;
    import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
    import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

    public class WordCount {

    public static class TokenizerMapper
    extends Mapper<Object, Text, Text, IntWritable>{

    private final static IntWritable one = new IntWritable(1);
    private Text word = new Text();

    public void map(Object key, Text value, Context context
    ) throws IOException, InterruptedException {
    StringTokenizer itr = new StringTokenizer(value.toString());
    while (itr.hasMoreTokens()) {
    word.set(itr.nextToken());
    context.write(word, one);
    }
    }
    }

    public static class IntSumReducer
    extends Reducer<Text,IntWritable,Text,IntWritable> {
    private IntWritable result = new IntWritable();

    public void reduce(Text key, Iterable<IntWritable> values,
    Context context
    ) throws IOException, InterruptedException {
    int sum = 0;
    for (IntWritable val : values) {
    sum += val.get();
    }
    result.set(sum);
    context.write(key, result);
    }
    }

    public static void main(String[] args) throws Exception {
    Configuration conf = new Configuration();
    Job job = Job.getInstance(conf, "word count");
    job.setJarByClass(WordCount.class);
    job.setMapperClass(TokenizerMapper.class);
    job.setCombinerClass(IntSumReducer.class);
    job.setReducerClass(IntSumReducer.class);
    job.setOutputKeyClass(Text.class);
    job.setOutputValueClass(IntWritable.class);
    FileInputFormat.addInputPath(job, new Path(args[0]));
    FileOutputFormat.setOutputPath(job, new Path(args[1]));
    System.exit(job.waitForCompletion(true) ? 0 : 1);
    }
    }
    scala-cli run --hadoop WordCount.java
    - + \ No newline at end of file