Skip to content

Commit acb0af0

Browse files
Allow to pass Java options to Bloop on the command-line (#162)
1 parent 603e2f8 commit acb0af0

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

modules/cli/src/main/scala/scala/cli/commands/BloopStart.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ object BloopStart extends ScalaCommand[BloopStartOptions] {
1515
)
1616
def run(options: BloopStartOptions, args: RemainingArgs): Unit = {
1717
val threads = BloopThreads.create()
18-
val bloopRifleConfig = options.bloopRifleConfig
18+
val bloopRifleConfig = options.bloopRifleConfig()
1919
val logger = options.logging.logger
2020

2121
val isRunning =

modules/cli/src/main/scala/scala/cli/commands/SharedCompilationServerOptions.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ final case class SharedCompilationServerOptions(
5353
@Group("Compilation server")
5454
@HelpMessage("Maximum duration to wait for compilation server to start up")
5555
@ValueDescription("duration")
56-
bloopStartupTimeout: Option[String] = None
56+
bloopStartupTimeout: Option[String] = None,
57+
58+
@Group("Compilation server")
59+
bloopDefaultJavaOpts: Boolean = true,
60+
@Group("Compilation server")
61+
bloopJavaOpt: List[String] = Nil
5762
) {
5863
// format: on
5964

@@ -177,7 +182,8 @@ final case class SharedCompilationServerOptions(
177182
bspStderr = if (verbosity >= 3) Some(System.err) else None,
178183
period = bloopBspCheckPeriodDuration.getOrElse(baseConfig.period),
179184
timeout = bloopBspTimeoutDuration.getOrElse(baseConfig.timeout),
180-
initTimeout = bloopStartupTimeoutDuration.getOrElse(baseConfig.initTimeout)
185+
initTimeout = bloopStartupTimeoutDuration.getOrElse(baseConfig.initTimeout),
186+
javaOpts = (if (bloopDefaultJavaOpts) baseConfig.javaOpts else Nil) ++ bloopJavaOpt
181187
)
182188
}
183189

website/docs/reference/cli-options.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ Duration between checks of the BSP connection state
9292

9393
Maximum duration to wait for compilation server to start up
9494

95+
#### `--bloop-default-java-opts`
96+
97+
#### `--bloop-java-opt`
98+
9599
## Compile options
96100

97101
Available in commands:

0 commit comments

Comments
 (0)