For a project, I need to start SBT with specific JVM options (-Dfile.encoding=UTF-8
and a number of memory/gc options) - but I don't necessarily want to apply those same options to every SBT project I have.
I've seen references (in sbt-extras) to the .sbtopts
(project-specific SBT command line options) and .jvmopts
(project-specific SBT JVM options) files that are supposed to support this, if found in the root directory of an SBT project, but the standard Windows version of SBT (I'm using version 0.13.1) seems to ignore them.
(The sbt-extras approach appeals to me because, assuming that .sbtopts
and .jvmopts
are tracked in version control, there is zero SBT configuration required for people wishing to build the project.)
Is there a current mechanism to specify project-specific SBT options that works cross platform?
UPDATE: Since I originally raised this question, .sbtopts
and .jvmopts
are now part of the standard Linux version of SBT, and sbt-extras is no longer required. However, the Windows version only supports .jvmopts
and does not recognize .sbtopts
.
.jvmopts
and.sbtopts
is an additional feature provided by sbt-extras, it is not supported by SBT itself. You should try running sbt-extras using cygwin. – gourlaysama.sbtopts
(in the current directory) is supported by sbt. It is only.jvmopts
that is added by sbt-extras. But.sbtopts
is enough: you can, for example, add-J-Xmx1G
so.sbtopts
instead of adding-Xmx1G
to.jvmopts
. But you are right, thesbt.bat
script doesn't read it on Windows... – gourlaysama.sbtopts
, but sadly the Windows runner doesn't. Even though it is a shell script, it is definitely packaged with SBT (0.13) itself. – gourlaysama.sbtopts
&.jvmopts
are supported since 1.3.14 (anno 2016) and mentioned in the updated question. I didn't read the update before writing this comment, so if you are reading this, you too have probably not read the update! 😄 – conny