From 85d55d4ae5a4be553bf35112e0faf2f9dc61a87f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bia=C5=82y?= Date: Fri, 24 May 2024 17:42:05 +0200 Subject: [PATCH] Allow passing options to scala-cli via language plugin executor (#503) * add BESOM_LANGHOST_SCALA_CLI_OPTS env var handling to scala-cli langhost executor * disable bloop in CI jobs --- .github/workflows/ci.yml | 2 ++ .../executors/executor_scala_cli.go | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de014154..1b901e3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,8 @@ jobs: build: if: "! github.event.pull_request.head.repo.fork" runs-on: ubuntu-latest + env: + BESOM_LANGHOST_SCALA_CLI_OPTS: "--server=false" timeout-minutes: 45 steps: - uses: actions/checkout@v4 diff --git a/language-plugin/pulumi-language-scala/executors/executor_scala_cli.go b/language-plugin/pulumi-language-scala/executors/executor_scala_cli.go index abb818f2..4a510741 100644 --- a/language-plugin/pulumi-language-scala/executors/executor_scala_cli.go +++ b/language-plugin/pulumi-language-scala/executors/executor_scala_cli.go @@ -3,6 +3,8 @@ package executors import ( + "os" + "github.com/virtuslab/besom/language-host/fsys" ) @@ -23,12 +25,13 @@ func (s scalacli) NewScalaExecutor(opts ScalaExecutorOptions) (*ScalaExecutor, e } func (scalacli) newScalaCliExecutor(cmd string, bootstrapLibJarPath string) (*ScalaExecutor, error) { + scalaCliOpts := os.Getenv("BESOM_LANGHOST_SCALA_CLI_OPTS") return &ScalaExecutor{ Name: "scala-cli", Cmd: cmd, - BuildArgs: []string{"compile", "."}, - RunArgs: []string{"run", "."}, - PluginArgs: []string{"run", ".", "--jar", bootstrapLibJarPath, "--main-class", "besom.bootstrap.PulumiPluginsDiscoverer"}, + BuildArgs: []string{"compile", ".", scalaCliOpts}, + RunArgs: []string{"run", ".", scalaCliOpts}, + PluginArgs: []string{"run", ".", scalaCliOpts, "--jar", bootstrapLibJarPath, "--main-class", "besom.bootstrap.PulumiPluginsDiscoverer"}, VersionArgs: []string{"version", "--cli", "--offline"}, }, nil }