Skip to content

Commit

Permalink
Bump scala-cli to 1.4.1 + drop old cli management (#21234)
Browse files Browse the repository at this point in the history
  • Loading branch information
bishabosha authored Jul 23, 2024
2 parents 2ea90c6 + 7695d9b commit 0e93a38
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 42 deletions.
15 changes: 1 addition & 14 deletions dist/bin-native-overrides/cli-common-platform
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
#!/usr/bin/env bash

if [[ ${cygwin-} || ${mingw-} || ${msys-} ]]; then
SCALA_CLI_VERSION=""
# iterate through lines in VERSION_SRC
while IFS= read -r line; do
# if line starts with "version:=" then extract the version
if [[ "$line" == cli_version:=* ]]; then
SCALA_CLI_VERSION="${line#cli_version:=}"
break
fi
done < "$PROG_HOME/EXTRA_PROPERTIES"
SCALA_CLI_CMD_BASH=("\"$PROG_HOME/bin/scala-cli\"" "--cli-version \"$SCALA_CLI_VERSION\"")
else
SCALA_CLI_CMD_BASH=("\"$PROG_HOME/bin/scala-cli\"")
fi
SCALA_CLI_CMD_BASH=("\"$PROG_HOME/bin/scala-cli\"")
21 changes: 1 addition & 20 deletions dist/bin-native-overrides/cli-common-platform.bat
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
@echo off

setlocal enabledelayedexpansion

set "_SCALA_CLI_VERSION="
@rem read for cli_version:=_SCALA_CLI_VERSION in EXTRA_PROPERTIES file
FOR /F "usebackq delims=" %%G IN ("%_PROG_HOME%\EXTRA_PROPERTIES") DO (
SET "line=%%G"
IF "!line:~0,13!"=="cli_version:=" (
SET "_SCALA_CLI_VERSION=!line:~13!"
GOTO :foundCliVersion
)
)

@REM we didn't find it, so we should fail
echo "ERROR: cli_version not found in EXTRA_PROPERTIES file"
exit /b 1

:foundCliVersion
endlocal & set "SCALA_CLI_VERSION=%_SCALA_CLI_VERSION%"

set SCALA_CLI_CMD_WIN="%_PROG_HOME%\bin\scala-cli.exe" "--cli-version" "%SCALA_CLI_VERSION%"
set SCALA_CLI_CMD_WIN="%_PROG_HOME%\bin\scala-cli.exe"
10 changes: 2 additions & 8 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ object Build {
val mimaPreviousLTSDottyVersion = "3.3.0"

/** Version of Scala CLI to download */
val scalaCliLauncherVersion = "1.4.0"
/** Version of Scala CLI to download (on Windows - last known validated version) */
val scalaCliLauncherVersionWindows = "1.4.0"
val scalaCliLauncherVersion = "1.4.1"
/** Version of Coursier to download for initializing the local maven repo of Scala command */
val coursierJarVersion = "2.1.10"

Expand Down Expand Up @@ -2185,12 +2183,8 @@ object Build {
republishBinDir := (dist / republishBinDir).value,
republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides",
republishFetchCoursier := (dist / republishFetchCoursier).value,
republishExtraProps += ("cli_version" -> scalaCliLauncherVersion),
republishLaunchers +=
("scala-cli.exe" -> s"zip+https://github.com/VirtusLab/scala-cli/releases/download/v$scalaCliLauncherVersionWindows/scala-cli-x86_64-pc-win32.zip!/scala-cli.exe")
)
.settings(
Universal / mappings += (republishRepo.value / "EXTRA_PROPERTIES" -> "EXTRA_PROPERTIES"),
("scala-cli.exe" -> s"zip+https://github.com/VirtusLab/scala-cli/releases/download/v$scalaCliLauncherVersion/scala-cli-x86_64-pc-win32.zip!/scala-cli.exe")
)
.settings(
Windows / name := "scala",
Expand Down

0 comments on commit 0e93a38

Please sign in to comment.