Skip to content

Commit

Permalink
add back in copy of mapped sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
bishabosha committed Jun 21, 2024
1 parent 9d41c7b commit c004c74
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
6 changes: 5 additions & 1 deletion dist/bin-native-overrides/cli-common-platform.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ FOR /F "usebackq delims=" %%G IN ("%_PROG_HOME%\EXTRA_PROPERTIES") DO (
)
)

@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" "--cli-version" "%SCALA_CLI_VERSION%"
2 changes: 1 addition & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2172,7 +2172,7 @@ object Build {
republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides",
republishFetchCoursier := (dist / republishFetchCoursier).value,
republishExtraProps += ("cli_version" -> scalaCliLauncherVersion),
mappings += (republishRepo.value / "etc" / "EXTRA_PROPERTIES" -> "EXTRA_PROPERTIES"),
mappings += (republishRepo.value / "EXTRA_PROPERTIES" -> "EXTRA_PROPERTIES"),
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")
)
Expand Down
14 changes: 12 additions & 2 deletions project/RepublishPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ object RepublishPlugin extends AutoPlugin {
val env = Map("COURSIER_CACHE" -> cache.getAbsolutePath.toString).asJava
val cmdLine0 = Seq(javaCmd, "-jar", jar0)
args =>
val cmdLine = cmdLine0 ++ args
val cmdLine = cmdLine0 ++ args
// invoke cmdLine with env, but also capture the output
val p = new ProcessBuilder(cmdLine: _*)
.directory(cache)
Expand Down Expand Up @@ -441,7 +441,7 @@ object RepublishPlugin extends AutoPlugin {
}
else {
val repoDir = republishRepo.value
val propsFile = repoDir / "etc" / "EXTRA_PROPERTIES"
val propsFile = repoDir / "EXTRA_PROPERTIES"
log.info(s"[republish] Writing extra properties to $propsFile...")
Using.fileWriter()(propsFile) { writer =>
extraProps.foreach { case (k, v) =>
Expand Down Expand Up @@ -485,6 +485,16 @@ object RepublishPlugin extends AutoPlugin {
import java.util.Date
val base: File = new File(".") // Using the working directory as base for readability

// Copy explicitly added dependencies
val mapped: Seq[(File, String)] = mappings.value
log.info("[republish] Copying explicit dependencies:")
val explicitDepsJars = for ((file, path) <- mapped) yield {
log.info(file.getPath)
val dest = distDir / path
IO.copyFile(file, dest, true)
dest
}

def write(path: String, content: String) {
val p = distDir / path
IO.write(p, content)
Expand Down

0 comments on commit c004c74

Please sign in to comment.