Skip to content

Bump scala-cli to 1.4.1 + drop old cli management #21234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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\"")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder do we really need this cli-common-platform files anymore. There seems to be exactly 1 usage for each of them

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Loading