diff --git a/dist/bin-native-overrides/cli-common-platform.bat b/dist/bin-native-overrides/cli-common-platform.bat index e0cfa40692b5..d1c4f1c4716b 100644 --- a/dist/bin-native-overrides/cli-common-platform.bat +++ b/dist/bin-native-overrides/cli-common-platform.bat @@ -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%" \ No newline at end of file +set SCALA_CLI_CMD_WIN="%_PROG_HOME%\bin\scala-cli.exe" "--cli-version" "%SCALA_CLI_VERSION%" diff --git a/project/Build.scala b/project/Build.scala index 3ce365fac9f1..b72715970fb1 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -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") ) diff --git a/project/RepublishPlugin.scala b/project/RepublishPlugin.scala index 6ce83c2f0abf..a0a8ce7dae74 100644 --- a/project/RepublishPlugin.scala +++ b/project/RepublishPlugin.scala @@ -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) @@ -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) => @@ -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)