diff --git a/dist/bin-native-overrides/cli-common-platform b/dist/bin-native-overrides/cli-common-platform deleted file mode 100644 index 49803d6282c5..000000000000 --- a/dist/bin-native-overrides/cli-common-platform +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -SCALA_CLI_CMD_BASH=("\"$PROG_HOME/bin/scala-cli\"") diff --git a/dist/bin-native-overrides/cli-common-platform.bat b/dist/bin-native-overrides/cli-common-platform.bat deleted file mode 100644 index 24ab08086007..000000000000 --- a/dist/bin-native-overrides/cli-common-platform.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -set SCALA_CLI_CMD_WIN="%_PROG_HOME%\bin\scala-cli.exe" diff --git a/dist/bin/scala b/dist/bin/scala index fa4f4cb25a11..81e11a4dffc2 100755 --- a/dist/bin/scala +++ b/dist/bin/scala @@ -26,8 +26,8 @@ if [ -z "${PROG_HOME-}" ] ; then cd "$saveddir" fi -source "$PROG_HOME/bin/common-shared" -source "$PROG_HOME/bin/cli-common-platform" +source "$PROG_HOME/libexec/common-shared" +source "$PROG_HOME/libexec/cli-common-platform" SCALA_VERSION="" # iterate through lines in VERSION_SRC diff --git a/dist/bin/scala.bat b/dist/bin/scala.bat index 7418909da263..bd5bf0b8dfbe 100644 --- a/dist/bin/scala.bat +++ b/dist/bin/scala.bat @@ -11,7 +11,7 @@ for %%f in ("%~dp0.") do ( @rem get rid of the trailing slash set "_PROG_HOME=!_PROG_HOME:~0,-1!" ) -call "%_PROG_HOME%\bin\common.bat" +call "%_PROG_HOME%\libexec\common.bat" if not %_EXITCODE%==0 goto end @rem ######################################################################### @@ -19,7 +19,7 @@ if not %_EXITCODE%==0 goto end call :setScalaOpts -call "%_PROG_HOME%\bin\cli-common-platform.bat" +call "%_PROG_HOME%\libexec\cli-common-platform.bat" @rem SCALA_CLI_CMD_WIN is an array, set in cli-common-platform.bat. @rem WE NEED TO PASS '--skip-cli-updates' for JVM launchers but we actually don't need it for native launchers diff --git a/dist/bin/scala_legacy b/dist/bin/scala_legacy index 18fc6d874e34..62755801819b 100755 --- a/dist/bin/scala_legacy +++ b/dist/bin/scala_legacy @@ -26,7 +26,7 @@ if [ -z "${PROG_HOME-}" ] ; then cd "$saveddir" fi -source "$PROG_HOME/bin/common" +source "$PROG_HOME/libexec/common" while [[ $# -gt 0 ]]; do case "$1" in diff --git a/dist/bin/scalac b/dist/bin/scalac index a527d9767749..ec91629a87ac 100755 --- a/dist/bin/scalac +++ b/dist/bin/scalac @@ -26,7 +26,7 @@ if [ -z "${PROG_HOME-}" ] ; then cd "$saveddir" fi -source "$PROG_HOME/bin/common" +source "$PROG_HOME/libexec/common" [ -z "$PROG_NAME" ] && PROG_NAME=$CompilerMain diff --git a/dist/bin/scalac.bat b/dist/bin/scalac.bat index e2898bdc2890..038c733f24c8 100644 --- a/dist/bin/scalac.bat +++ b/dist/bin/scalac.bat @@ -11,7 +11,7 @@ for %%f in ("%~dp0.") do ( @rem get rid of the trailing slash set "_PROG_HOME=!_PROG_HOME:~0,-1!" ) -call "%_PROG_HOME%\bin\common.bat" +call "%_PROG_HOME%\libexec\common.bat" if not %_EXITCODE%==0 goto end call :args %* diff --git a/dist/bin/scaladoc b/dist/bin/scaladoc index 0af5a2b55acb..e137176e819f 100755 --- a/dist/bin/scaladoc +++ b/dist/bin/scaladoc @@ -28,7 +28,7 @@ if [ -z "${PROG_HOME-}" ] ; then cd "$saveddir" fi -source "$PROG_HOME/bin/common" +source "$PROG_HOME/libexec/common" default_java_opts="-Xmx768m -Xms768m" withCompiler=true diff --git a/dist/bin/scaladoc.bat b/dist/bin/scaladoc.bat index b9e4820b006d..2be13aa628b1 100644 --- a/dist/bin/scaladoc.bat +++ b/dist/bin/scaladoc.bat @@ -11,7 +11,7 @@ for %%f in ("%~dp0.") do ( @rem get rid of the trailing slash set "_PROG_HOME=!_PROG_HOME:~0,-1!" ) -call "%_PROG_HOME%\bin\common.bat" +call "%_PROG_HOME%\libexec\common.bat" if not %_EXITCODE%==0 goto end set _DEFAULT_JAVA_OPTS=-Xmx768m -Xms768m diff --git a/dist/libexec-native-overrides/cli-common-platform b/dist/libexec-native-overrides/cli-common-platform new file mode 100644 index 000000000000..246cbc58d5c7 --- /dev/null +++ b/dist/libexec-native-overrides/cli-common-platform @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +SCALA_CLI_CMD_BASH=("\"$PROG_HOME/libexec/scala-cli\"") diff --git a/dist/libexec-native-overrides/cli-common-platform.bat b/dist/libexec-native-overrides/cli-common-platform.bat new file mode 100644 index 000000000000..239ab40f1f28 --- /dev/null +++ b/dist/libexec-native-overrides/cli-common-platform.bat @@ -0,0 +1,3 @@ +@echo off + +set SCALA_CLI_CMD_WIN="%_PROG_HOME%\libexec\scala-cli.exe" diff --git a/dist/bin/cli-common-platform b/dist/libexec/cli-common-platform similarity index 100% rename from dist/bin/cli-common-platform rename to dist/libexec/cli-common-platform diff --git a/dist/bin/cli-common-platform.bat b/dist/libexec/cli-common-platform.bat similarity index 100% rename from dist/bin/cli-common-platform.bat rename to dist/libexec/cli-common-platform.bat diff --git a/dist/bin/common b/dist/libexec/common similarity index 95% rename from dist/bin/common rename to dist/libexec/common index 2de8bdf9f99a..28b5d66a9ed3 100644 --- a/dist/bin/common +++ b/dist/libexec/common @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$PROG_HOME/bin/common-shared" +source "$PROG_HOME/libexec/common-shared" #/*-------------------------------------------------- # * The code below is for Dotty diff --git a/dist/bin/common-shared b/dist/libexec/common-shared similarity index 100% rename from dist/bin/common-shared rename to dist/libexec/common-shared diff --git a/dist/bin/common.bat b/dist/libexec/common.bat similarity index 100% rename from dist/bin/common.bat rename to dist/libexec/common.bat diff --git a/project/Build.scala b/project/Build.scala index 54ac84734486..e6592f67ce3d 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -2137,9 +2137,10 @@ object Build { Universal / packageBin := (Universal / packageBin).dependsOn(republish).value, Universal / packageZipTarball := (Universal / packageZipTarball).dependsOn(republish).value, // ======== - Universal / mappings ++= directory(republishRepo.value / "bin"), + Universal / mappings ++= directory(dist.base / "bin"), Universal / mappings ++= directory(republishRepo.value / "maven2"), Universal / mappings ++= directory(republishRepo.value / "lib"), + Universal / mappings ++= directory(republishRepo.value / "libexec"), Universal / mappings += (republishRepo.value / "VERSION") -> "VERSION", // ======== republishCommandLibs += ("scala" -> List("scala3-interfaces", "scala3-compiler", "scala3-library", "tasty-core")), @@ -2150,7 +2151,7 @@ object Build { lazy val dist = project.asDist(Bootstrapped) .settings(packageName := "scala3-" + dottyVersion) .settings( - republishBinDir := baseDirectory.value / "bin", + republishLibexecDir := baseDirectory.value / "libexec", republishCoursier += ("coursier.jar" -> s"https://github.com/coursier/coursier/releases/download/v$coursierJarVersion/coursier.jar"), republishLaunchers += @@ -2160,8 +2161,8 @@ object Build { lazy val `dist-mac-x86_64` = project.in(file("dist/mac-x86_64")).asDist(Bootstrapped) .settings(packageName := (dist / packageName).value + "-x86_64-apple-darwin") .settings( - republishBinDir := (dist / republishBinDir).value, - republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides", + republishLibexecDir := (dist / republishLibexecDir).value, + republishLibexecOverrides += (dist / baseDirectory).value / "libexec-native-overrides", republishFetchCoursier := (dist / republishFetchCoursier).value, republishLaunchers += ("scala-cli" -> s"gz+https://github.com/VirtusLab/scala-cli/releases/download/v$scalaCliLauncherVersion/scala-cli-x86_64-apple-darwin.gz") @@ -2170,8 +2171,8 @@ object Build { lazy val `dist-mac-aarch64` = project.in(file("dist/mac-aarch64")).asDist(Bootstrapped) .settings(packageName := (dist / packageName).value + "-aarch64-apple-darwin") .settings( - republishBinDir := (dist / republishBinDir).value, - republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides", + republishLibexecDir := (dist / republishLibexecDir).value, + republishLibexecOverrides += (dist / baseDirectory).value / "libexec-native-overrides", republishFetchCoursier := (dist / republishFetchCoursier).value, republishLaunchers += ("scala-cli" -> s"gz+https://github.com/VirtusLab/scala-cli/releases/download/v$scalaCliLauncherVersion/scala-cli-aarch64-apple-darwin.gz") @@ -2181,8 +2182,8 @@ object Build { .enablePlugins(WindowsPlugin) // TO GENERATE THE `.msi` installer .settings(packageName := (dist / packageName).value + "-x86_64-pc-win32") .settings( - republishBinDir := (dist / republishBinDir).value, - republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides", + republishLibexecDir := (dist / republishLibexecDir).value, + republishLibexecOverrides += (dist / baseDirectory).value / "libexec-native-overrides", republishFetchCoursier := (dist / republishFetchCoursier).value, republishLaunchers += ("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") @@ -2204,8 +2205,8 @@ object Build { lazy val `dist-linux-x86_64` = project.in(file("dist/linux-x86_64")).asDist(Bootstrapped) .settings(packageName := (dist / packageName).value + "-x86_64-pc-linux") .settings( - republishBinDir := (dist / republishBinDir).value, - republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides", + republishLibexecDir := (dist / republishLibexecDir).value, + republishLibexecOverrides += (dist / baseDirectory).value / "libexec-native-overrides", republishFetchCoursier := (dist / republishFetchCoursier).value, republishLaunchers += ("scala-cli" -> s"gz+https://github.com/VirtusLab/scala-cli/releases/download/v$scalaCliLauncherVersion/scala-cli-x86_64-pc-linux.gz") @@ -2214,8 +2215,8 @@ object Build { lazy val `dist-linux-aarch64` = project.in(file("dist/linux-aarch64")).asDist(Bootstrapped) .settings(packageName := (dist / packageName).value + "-aarch64-pc-linux") .settings( - republishBinDir := (dist / republishBinDir).value, - republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides", + republishLibexecDir := (dist / republishLibexecDir).value, + republishLibexecOverrides += (dist / baseDirectory).value / "libexec-native-overrides", republishFetchCoursier := (dist / republishFetchCoursier).value, republishLaunchers += ("scala-cli" -> s"gz+https://github.com/VirtusLab/scala-cli/releases/download/v$scalaCliLauncherVersion/scala-cli-aarch64-pc-linux.gz") diff --git a/project/RepublishPlugin.scala b/project/RepublishPlugin.scala index ff469e8fda56..f1faeca3d9cd 100644 --- a/project/RepublishPlugin.scala +++ b/project/RepublishPlugin.scala @@ -60,9 +60,9 @@ object RepublishPlugin extends AutoPlugin { val republishFetchCoursier = taskKey[File]("cache the coursier.jar for resolving the local maven repo.") val republishPrepareBin = taskKey[File]("prepare the bin directory, including launchers and scripts.") val republishWriteExtraProps = taskKey[Option[File]]("write extra properties for the launchers.") - val republishBinDir = settingKey[File]("where to find static files for the bin dir.") + val republishLibexecDir = settingKey[File]("where to find static files for the `libexec` dir.") val republishCoursierDir = settingKey[File]("where to download the coursier launcher jar.") - val republishBinOverrides = settingKey[Seq[File]]("files to override those in bin-dir.") + val republishLibexecOverrides = settingKey[Seq[File]]("files to override those in libexec-dir.") val republishCommandLibs = settingKey[Seq[(String, List[String])]]("libraries needed for each command.") val republish = taskKey[File]("cache the dependencies and download launchers for the distribution") val republishPack = taskKey[File]("do the pack command") @@ -405,7 +405,7 @@ object RepublishPlugin extends AutoPlugin { republishCoursierDir := republishRepo.value / "coursier", republishLaunchers := Seq.empty, republishCoursier := Seq.empty, - republishBinOverrides := Seq.empty, + republishLibexecOverrides := Seq.empty, republishExtraProps := Seq.empty, republishCommandLibs := Seq.empty, republishLocalResolved / republishProjectRefs := { @@ -489,16 +489,14 @@ object RepublishPlugin extends AutoPlugin { }, republishPrepareBin := { val baseDir = baseDirectory.value - val srcBin = republishBinDir.value - val overrides = republishBinOverrides.value + val srcLibexec = republishLibexecDir.value + val overrides = republishLibexecOverrides.value val repoDir = republishRepo.value - val targetBin = repoDir / "bin" - IO.copyDirectory(srcBin, targetBin) - overrides.foreach { dir => - IO.copyDirectory(dir, targetBin, overwrite = true) - } - targetBin + val targetLibexec = repoDir / "libexec" + IO.copyDirectory(srcLibexec, targetLibexec) + overrides.foreach(IO.copyDirectory(_, targetLibexec, overwrite = true)) + targetLibexec }, republishWriteExtraProps := { val s = streams.value