Skip to content

Shared JVM options for all scripts #434

@markarasev

Description

@markarasev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions