Skip to content

Commit e44dd59

Browse files
committed
Introduce libexec folder in the distribution
1 parent d490d13 commit e44dd59

18 files changed

+38
-39
lines changed

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

Lines changed: 0 additions & 3 deletions
This file was deleted.

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

Lines changed: 0 additions & 3 deletions
This file was deleted.

dist/bin/scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ if [ -z "${PROG_HOME-}" ] ; then
2626
cd "$saveddir"
2727
fi
2828

29-
source "$PROG_HOME/bin/common-shared"
30-
source "$PROG_HOME/bin/cli-common-platform"
29+
source "$PROG_HOME/libexec/common-shared"
30+
source "$PROG_HOME/libexec/cli-common-platform"
3131

3232
SCALA_VERSION=""
3333
# iterate through lines in VERSION_SRC

dist/bin/scala.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ for %%f in ("%~dp0.") do (
1111
@rem get rid of the trailing slash
1212
set "_PROG_HOME=!_PROG_HOME:~0,-1!"
1313
)
14-
call "%_PROG_HOME%\bin\common.bat"
14+
call "%_PROG_HOME%\libexec\common.bat"
1515
if not %_EXITCODE%==0 goto end
1616

1717
@rem #########################################################################
1818
@rem ## Main
1919

2020
call :setScalaOpts
2121

22-
call "%_PROG_HOME%\bin\cli-common-platform.bat"
22+
call "%_PROG_HOME%\libexec\cli-common-platform.bat"
2323

2424
@rem SCALA_CLI_CMD_WIN is an array, set in cli-common-platform.bat.
2525
@rem WE NEED TO PASS '--skip-cli-updates' for JVM launchers but we actually don't need it for native launchers

dist/bin/scala_legacy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if [ -z "${PROG_HOME-}" ] ; then
2626
cd "$saveddir"
2727
fi
2828

29-
source "$PROG_HOME/bin/common"
29+
source "$PROG_HOME/libexec/common"
3030

3131
while [[ $# -gt 0 ]]; do
3232
case "$1" in

dist/bin/scalac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if [ -z "${PROG_HOME-}" ] ; then
2626
cd "$saveddir"
2727
fi
2828

29-
source "$PROG_HOME/bin/common"
29+
source "$PROG_HOME/libexec/common"
3030

3131
[ -z "$PROG_NAME" ] && PROG_NAME=$CompilerMain
3232

dist/bin/scalac.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ for %%f in ("%~dp0.") do (
1111
@rem get rid of the trailing slash
1212
set "_PROG_HOME=!_PROG_HOME:~0,-1!"
1313
)
14-
call "%_PROG_HOME%\bin\common.bat"
14+
call "%_PROG_HOME%\libexec\common.bat"
1515
if not %_EXITCODE%==0 goto end
1616

1717
call :args %*

dist/bin/scaladoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if [ -z "${PROG_HOME-}" ] ; then
2828
cd "$saveddir"
2929
fi
3030

31-
source "$PROG_HOME/bin/common"
31+
source "$PROG_HOME/libexec/common"
3232
default_java_opts="-Xmx768m -Xms768m"
3333
withCompiler=true
3434

dist/bin/scaladoc.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ for %%f in ("%~dp0.") do (
1111
@rem get rid of the trailing slash
1212
set "_PROG_HOME=!_PROG_HOME:~0,-1!"
1313
)
14-
call "%_PROG_HOME%\bin\common.bat"
14+
call "%_PROG_HOME%\libexec\common.bat"
1515
if not %_EXITCODE%==0 goto end
1616

1717
set _DEFAULT_JAVA_OPTS=-Xmx768m -Xms768m
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
SCALA_CLI_CMD_BASH=("\"$PROG_HOME/libexec/scala-cli\"")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
3+
set SCALA_CLI_CMD_WIN="%_PROG_HOME%\libexec\scala-cli.exe"
File renamed without changes.

dist/bin/common renamed to dist/libexec/common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
source "$PROG_HOME/bin/common-shared"
3+
source "$PROG_HOME/libexec/common-shared"
44

55
#/*--------------------------------------------------
66
# * The code below is for Dotty
File renamed without changes.
File renamed without changes.

project/Build.scala

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2137,9 +2137,10 @@ object Build {
21372137
Universal / packageBin := (Universal / packageBin).dependsOn(republish).value,
21382138
Universal / packageZipTarball := (Universal / packageZipTarball).dependsOn(republish).value,
21392139
// ========
2140-
Universal / mappings ++= directory(republishRepo.value / "bin"),
2140+
Universal / mappings ++= directory(dist.base / "bin"),
21412141
Universal / mappings ++= directory(republishRepo.value / "maven2"),
21422142
Universal / mappings ++= directory(republishRepo.value / "lib"),
2143+
Universal / mappings ++= directory(republishRepo.value / "libexec"),
21432144
Universal / mappings += (republishRepo.value / "VERSION") -> "VERSION",
21442145
// ========
21452146
republishCommandLibs += ("scala" -> List("scala3-interfaces", "scala3-compiler", "scala3-library", "tasty-core")),
@@ -2150,7 +2151,7 @@ object Build {
21502151
lazy val dist = project.asDist(Bootstrapped)
21512152
.settings(packageName := "scala3-" + dottyVersion)
21522153
.settings(
2153-
republishBinDir := baseDirectory.value / "bin",
2154+
republishLibexecDir := baseDirectory.value / "libexec",
21542155
republishCoursier +=
21552156
("coursier.jar" -> s"https://github.com/coursier/coursier/releases/download/v$coursierJarVersion/coursier.jar"),
21562157
republishLaunchers +=
@@ -2160,8 +2161,8 @@ object Build {
21602161
lazy val `dist-mac-x86_64` = project.in(file("dist/mac-x86_64")).asDist(Bootstrapped)
21612162
.settings(packageName := (dist / packageName).value + "-x86_64-apple-darwin")
21622163
.settings(
2163-
republishBinDir := (dist / republishBinDir).value,
2164-
republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides",
2164+
republishLibexecDir := (dist / republishLibexecDir).value,
2165+
republishLibexecOverrides += (dist / baseDirectory).value / "libexec-native-overrides",
21652166
republishFetchCoursier := (dist / republishFetchCoursier).value,
21662167
republishLaunchers +=
21672168
("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 {
21702171
lazy val `dist-mac-aarch64` = project.in(file("dist/mac-aarch64")).asDist(Bootstrapped)
21712172
.settings(packageName := (dist / packageName).value + "-aarch64-apple-darwin")
21722173
.settings(
2173-
republishBinDir := (dist / republishBinDir).value,
2174-
republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides",
2174+
republishLibexecDir := (dist / republishLibexecDir).value,
2175+
republishLibexecOverrides += (dist / baseDirectory).value / "libexec-native-overrides",
21752176
republishFetchCoursier := (dist / republishFetchCoursier).value,
21762177
republishLaunchers +=
21772178
("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 {
21812182
.enablePlugins(WindowsPlugin) // TO GENERATE THE `.msi` installer
21822183
.settings(packageName := (dist / packageName).value + "-x86_64-pc-win32")
21832184
.settings(
2184-
republishBinDir := (dist / republishBinDir).value,
2185-
republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides",
2185+
republishLibexecDir := (dist / republishLibexecDir).value,
2186+
republishLibexecOverrides += (dist / baseDirectory).value / "libexec-native-overrides",
21862187
republishFetchCoursier := (dist / republishFetchCoursier).value,
21872188
republishLaunchers +=
21882189
("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 {
22042205
lazy val `dist-linux-x86_64` = project.in(file("dist/linux-x86_64")).asDist(Bootstrapped)
22052206
.settings(packageName := (dist / packageName).value + "-x86_64-pc-linux")
22062207
.settings(
2207-
republishBinDir := (dist / republishBinDir).value,
2208-
republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides",
2208+
republishLibexecDir := (dist / republishLibexecDir).value,
2209+
republishLibexecOverrides += (dist / baseDirectory).value / "libexec-native-overrides",
22092210
republishFetchCoursier := (dist / republishFetchCoursier).value,
22102211
republishLaunchers +=
22112212
("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 {
22142215
lazy val `dist-linux-aarch64` = project.in(file("dist/linux-aarch64")).asDist(Bootstrapped)
22152216
.settings(packageName := (dist / packageName).value + "-aarch64-pc-linux")
22162217
.settings(
2217-
republishBinDir := (dist / republishBinDir).value,
2218-
republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides",
2218+
republishLibexecDir := (dist / republishLibexecDir).value,
2219+
republishLibexecOverrides += (dist / baseDirectory).value / "libexec-native-overrides",
22192220
republishFetchCoursier := (dist / republishFetchCoursier).value,
22202221
republishLaunchers +=
22212222
("scala-cli" -> s"gz+https://github.com/VirtusLab/scala-cli/releases/download/v$scalaCliLauncherVersion/scala-cli-aarch64-pc-linux.gz")

project/RepublishPlugin.scala

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ object RepublishPlugin extends AutoPlugin {
6060
val republishFetchCoursier = taskKey[File]("cache the coursier.jar for resolving the local maven repo.")
6161
val republishPrepareBin = taskKey[File]("prepare the bin directory, including launchers and scripts.")
6262
val republishWriteExtraProps = taskKey[Option[File]]("write extra properties for the launchers.")
63-
val republishBinDir = settingKey[File]("where to find static files for the bin dir.")
63+
val republishLibexecDir = settingKey[File]("where to find static files for the `libexec` dir.")
6464
val republishCoursierDir = settingKey[File]("where to download the coursier launcher jar.")
65-
val republishBinOverrides = settingKey[Seq[File]]("files to override those in bin-dir.")
65+
val republishLibexecOverrides = settingKey[Seq[File]]("files to override those in libexec-dir.")
6666
val republishCommandLibs = settingKey[Seq[(String, List[String])]]("libraries needed for each command.")
6767
val republish = taskKey[File]("cache the dependencies and download launchers for the distribution")
6868
val republishPack = taskKey[File]("do the pack command")
@@ -405,7 +405,7 @@ object RepublishPlugin extends AutoPlugin {
405405
republishCoursierDir := republishRepo.value / "coursier",
406406
republishLaunchers := Seq.empty,
407407
republishCoursier := Seq.empty,
408-
republishBinOverrides := Seq.empty,
408+
republishLibexecOverrides := Seq.empty,
409409
republishExtraProps := Seq.empty,
410410
republishCommandLibs := Seq.empty,
411411
republishLocalResolved / republishProjectRefs := {
@@ -489,16 +489,14 @@ object RepublishPlugin extends AutoPlugin {
489489
},
490490
republishPrepareBin := {
491491
val baseDir = baseDirectory.value
492-
val srcBin = republishBinDir.value
493-
val overrides = republishBinOverrides.value
492+
val srcLibexec = republishLibexecDir.value
493+
val overrides = republishLibexecOverrides.value
494494
val repoDir = republishRepo.value
495495

496-
val targetBin = repoDir / "bin"
497-
IO.copyDirectory(srcBin, targetBin)
498-
overrides.foreach { dir =>
499-
IO.copyDirectory(dir, targetBin, overwrite = true)
500-
}
501-
targetBin
496+
val targetLibexec = repoDir / "libexec"
497+
IO.copyDirectory(srcLibexec, targetLibexec)
498+
overrides.foreach(IO.copyDirectory(_, targetLibexec, overwrite = true))
499+
targetLibexec
502500
},
503501
republishWriteExtraProps := {
504502
val s = streams.value

0 commit comments

Comments
 (0)