Skip to content

Commit

Permalink
Merge pull request #3450 from Gedochao/maintenance/setup-ide-bsp-test…
Browse files Browse the repository at this point in the history
…-with-cli-snapshot

Bump Scala CLI launchers to v1.6.0
  • Loading branch information
Gedochao authored Jan 21, 2025
2 parents 38205e1 + 43f4be9 commit a41f43b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2191,28 +2191,27 @@ abstract class BspTestDefinitions extends ScalaCliSuite with TestScalaVersionArg
}
}

// TODO: test for the most recent CLI version as well when 1.5.1 is out
for { cliVersion <- Seq("1.5.0-34-g31a88e428-SNAPSHOT") }
for { cliVersion <- Seq("1.5.0-34-g31a88e428-SNAPSHOT", "1.6.0") }
test(
s"setup-ide prepares a valid BSP configuration with --cli-version $cliVersion"
) {
val scriptName = "cli-version.sc"
val inputs = TestInputs(
os.rel / scriptName -> s"""println("Hello from launcher v$cliVersion")"""
)
inputs.fromRoot { root =>
val cliVersionArgs = List("--cli-version", cliVersion)
os.proc(TestUtil.cli, cliVersionArgs, "setup-ide", scriptName, extraOptions).call(cwd =
root
)
val expectedIdeLauncherFile =
root / Constants.workspaceDirName / "ide-launcher-options.json"
expect(expectedIdeLauncherFile.toNIO.toFile.exists())
expect(os.read(expectedIdeLauncherFile).contains(cliVersion))
val bspConfig = readBspConfig(root)
expect(bspConfig.argv.head == TestUtil.cliPath)
expect(bspConfig.argv.containsSlice(cliVersionArgs))
expect(bspConfig.argv.indexOfSlice(cliVersionArgs) < bspConfig.argv.indexOf("bsp"))
TestUtil.retryOnCi() {
val scriptName = "cli-version.sc"
TestInputs(os.rel / scriptName -> s"""println("Hello from launcher v$cliVersion")""")
.fromRoot { root =>
val cliVersionArgs = List("--cli-version", cliVersion)
os.proc(TestUtil.cli, cliVersionArgs, "setup-ide", scriptName, extraOptions).call(cwd =
root
)
val expectedIdeLauncherFile =
root / Constants.workspaceDirName / "ide-launcher-options.json"
expect(expectedIdeLauncherFile.toNIO.toFile.exists())
expect(os.read(expectedIdeLauncherFile).contains(cliVersion))
val bspConfig = readBspConfig(root)
expect(bspConfig.argv.head == TestUtil.cliPath)
expect(bspConfig.argv.containsSlice(cliVersionArgs))
expect(bspConfig.argv.indexOfSlice(cliVersionArgs) < bspConfig.argv.indexOf("bsp"))
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion scala-cli.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ rem Download the latest version of this script at https://github.com/VirtusLab/s

setlocal enabledelayedexpansion

set "SCALA_CLI_VERSION=1.5.4"
set "SCALA_CLI_VERSION=1.6.0"

set SCALA_CLI_URL=https://github.com/VirtusLab/scala-cli/releases/download/v%SCALA_CLI_VERSION%/scala-cli.bat
set CACHE_BASE=%localappdata%/Coursier/v1
Expand Down
2 changes: 1 addition & 1 deletion scala-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

set -eu

SCALA_CLI_VERSION="1.5.4"
SCALA_CLI_VERSION="1.6.0"

GH_ORG="VirtusLab"
GH_NAME="scala-cli"
Expand Down

0 comments on commit a41f43b

Please sign in to comment.