Skip to content

Commit c004c74

Browse files
committed
add back in copy of mapped sequence
1 parent 9d41c7b commit c004c74

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

dist/bin-native-overrides/cli-common-platform.bat

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ FOR /F "usebackq delims=" %%G IN ("%_PROG_HOME%\EXTRA_PROPERTIES") DO (
1212
)
1313
)
1414

15+
@REM we didn't find it, so we should fail
16+
echo "ERROR: cli_version not found in EXTRA_PROPERTIES file"
17+
exit /b 1
18+
1519
:foundCliVersion
1620
endlocal & set "SCALA_CLI_VERSION=%_SCALA_CLI_VERSION%"
1721

18-
set SCALA_CLI_CMD_WIN="%_PROG_HOME%\bin\scala-cli.exe" "--cli-version" "%SCALA_CLI_VERSION%"
22+
set SCALA_CLI_CMD_WIN="%_PROG_HOME%\bin\scala-cli.exe" "--cli-version" "%SCALA_CLI_VERSION%"

project/Build.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2172,7 +2172,7 @@ object Build {
21722172
republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides",
21732173
republishFetchCoursier := (dist / republishFetchCoursier).value,
21742174
republishExtraProps += ("cli_version" -> scalaCliLauncherVersion),
2175-
mappings += (republishRepo.value / "etc" / "EXTRA_PROPERTIES" -> "EXTRA_PROPERTIES"),
2175+
mappings += (republishRepo.value / "EXTRA_PROPERTIES" -> "EXTRA_PROPERTIES"),
21762176
republishLaunchers +=
21772177
("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")
21782178
)

project/RepublishPlugin.scala

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ object RepublishPlugin extends AutoPlugin {
114114
val env = Map("COURSIER_CACHE" -> cache.getAbsolutePath.toString).asJava
115115
val cmdLine0 = Seq(javaCmd, "-jar", jar0)
116116
args =>
117-
val cmdLine = cmdLine0 ++ args
117+
val cmdLine = cmdLine0 ++ args
118118
// invoke cmdLine with env, but also capture the output
119119
val p = new ProcessBuilder(cmdLine: _*)
120120
.directory(cache)
@@ -441,7 +441,7 @@ object RepublishPlugin extends AutoPlugin {
441441
}
442442
else {
443443
val repoDir = republishRepo.value
444-
val propsFile = repoDir / "etc" / "EXTRA_PROPERTIES"
444+
val propsFile = repoDir / "EXTRA_PROPERTIES"
445445
log.info(s"[republish] Writing extra properties to $propsFile...")
446446
Using.fileWriter()(propsFile) { writer =>
447447
extraProps.foreach { case (k, v) =>
@@ -485,6 +485,16 @@ object RepublishPlugin extends AutoPlugin {
485485
import java.util.Date
486486
val base: File = new File(".") // Using the working directory as base for readability
487487

488+
// Copy explicitly added dependencies
489+
val mapped: Seq[(File, String)] = mappings.value
490+
log.info("[republish] Copying explicit dependencies:")
491+
val explicitDepsJars = for ((file, path) <- mapped) yield {
492+
log.info(file.getPath)
493+
val dest = distDir / path
494+
IO.copyFile(file, dest, true)
495+
dest
496+
}
497+
488498
def write(path: String, content: String) {
489499
val p = distDir / path
490500
IO.write(p, content)

0 commit comments

Comments
 (0)