Skip to content

Commit

Permalink
bugfix: Take into account space in sbtopts
Browse files Browse the repository at this point in the history
I couldn't find any information about how .sbtopts should look like, but splitting on space should be ok. Especially that with spaces this doesn't work -> sbt/sbt#7333

Fixes #6858
  • Loading branch information
tgodzik committed Oct 18, 2024
1 parent b1c3856 commit 27a6a4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ object SbtOpts {
Some(noGlobalOpts)
else if (sbtToJdkOpts.exists { case (k, _) => opt.startsWith(k) })
processOptWithArg(opt)
else if (opt.contains(" "))
process(opt.split("\\s+").toList)
else if (opt.startsWith("-J"))
Some(opt.substring(2))
else if (opt.startsWith("-D"))
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/src/test/scala/tests/SbtOptsSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ class SbtOptsSuite extends BaseSuite {
|-sbt-dir /some/where/else/sbt
|-ivy /some/where/ivy
|-jvm-debug 4711
|-J-Xmx5G -J-XX:+UseG1GC
|
""".stripMargin,
"""
|-Dsbt.boot.directory=/some/where/sbt/boot
|-Dsbt.global.base=/some/where/else/sbt
|-Dsbt.ivy.home=/some/where/ivy
|-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4711
|-Xmx5G
|-XX:+UseG1GC
""".stripMargin,
)

Expand Down

0 comments on commit 27a6a4c

Please sign in to comment.