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

Make main class optional in preamble-less assemblies #1200

Merged

Conversation

alexarchambault
Copy link
Contributor

@alexarchambault alexarchambault commented Jul 25, 2022

These changes allow one to generate an assembly, even for code that has no main class, when --preamble=false is passed. This can be useful for libraries, if users want to pass the assembly to tools such as proguard. This also accepts a (hidden) --main-class-in-manifest=false option if users want not only no preamble, but also no mention of main class in the assembly manifest (META-INF/MANIFEST.MF in the assembly JAR). The latter option is useful for tools, such as the hadoop jar command, that behave differently depending on the presence or not of a main class in the manifest.

This allows to generate assemblies with
'scala-cli package --assembly --preamble=false' even when no main class
is defined. This can be handy to make assemblies that are not meant to
be run as is, but are passed to other tools (such as proguard).
@alexarchambault alexarchambault merged commit 403bdb6 into VirtusLab:main Jul 26, 2022
@alexarchambault alexarchambault deleted the allow-no-main-class-assemblies branch July 26, 2022 13:06
@Gedochao Gedochao added the enhancement New feature or request label Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants