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

Shared JVM options for all scripts #434

Open
markarasev opened this issue Aug 10, 2023 · 1 comment
Open

Shared JVM options for all scripts #434

markarasev opened this issue Aug 10, 2023 · 1 comment

Comments

@markarasev
Copy link

markarasev commented Aug 10, 2023

We have a project that generates a lot of executable scripts using sbt-pack (159 as of today, still growing), and we have a few JVM options that we would like all executables to share. The packJvmOpts requires to specify every script name which is cumbersome in our situation. Also, these options should be used in every new script, and it is really easy to forget to add a new entry in packJvmOpts.

What I naturally tried was packJvmOpts := Map("*" -> Seq("-D...")), but obviously it didn't work. While it would be nice to support "*", it may imply to support glob patterns as a whole for consistency, and therefore significantly complicate the implementation and the options merging logic (this consideration stands for regexes too).

Another simpler alternative would be to add a packSharedJvmOpts setting.

WDYT?

Note: I also tried to write a custom task using the generated value of packMain to build packJvmOpts, but I could not overwrite the pack task to do this (creating a new custom myPack task calling pack under the hood does the job but is not ideal), but this is more of a SBT-related issue.

@xerial
Copy link
Owner

xerial commented Aug 22, 2023

Supporting wildcard * looks good and would work for your use case:

packJvmOpts := Map("*" -> Seq("-D...")) 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants