Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add information about --preamble in assembly packaging documentation #2713

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion website/docs/commands/package.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,25 @@ Hello
Hello
-->

By default assemblies are self-executable, just like the default package format. With the `--preamble=false` option, you can build an assembly that just contains the JAR and does not contain any built-in Bash code, and therefore can be launched directly with Java and is more portable:

<ChainedSnippets>

```bash
scala-cli --power package Hello.scala -o hello.jar --assembly --preamble=false
java -jar hello.jar
```

```text
Hello
```

</ChainedSnippets>

<!-- Expected:
Hello
-->

## Docker container

Scala CLI can create an executable application and package it into a docker image.
Expand Down Expand Up @@ -506,4 +525,3 @@ The using directive allows you to define the image repository.
```scala compile power
//> using packaging.dockerImageRepository scala-cli
```

Loading