[2.0.x] restore JVM option capability in the launcher config (#9465)

Restores override-build-repos config option responsible for passing the JVM flag to the launcher.

Co-authored-by: Anatolii Kmetiuk <anatoliikmt@proton.me>
This commit is contained in:
eugene yokota 2026-07-16 13:46:25 -04:00 committed by GitHub
parent c987acd3da
commit 19a71f316e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 42 additions and 1 deletions

View File

@ -25,5 +25,6 @@
[ivy]
ivy-home: ${sbt.ivy.home-${user.home}/.ivy2/}
checksums: ${sbt.checksums-sha1,md5}
override-build-repos: ${sbt.override.build.repos-false}
repository-override: ${sbt.repository.override-${sbt.global.base-${user.home}/.sbt}/repositories_force}
repository-config: ${sbt.repository.config-${sbt.global.base-${user.home}/.sbt}/repositories}

View File

@ -17,7 +17,7 @@ object Dependencies {
private val sbtIO = "org.scala-sbt" %% "io" % ioVersion
val launcherVersion = "1.6.0"
val launcherVersion = "1.6.2"
val launcherInterface = "org.scala-sbt" % "launcher-interface" % launcherVersion
val rawLauncher = "org.scala-sbt" % "launcher" % launcherVersion
val testInterface = "org.scala-sbt" % "test-interface" % "1.0"

View File

@ -0,0 +1,28 @@
import scala.sys.process.*
lazy val check = taskKey[Unit]("Verifies the repository override property applies to an sbt 1 meta-build")
lazy val root = (project in file(".")).settings(
check := {
val base = baseDirectory.value
val globalBase = base / "global"
val launcher = file(sys.props("sbt.launch.jar"))
val java = file(sys.props("java.home")) / "bin" / "java"
val exitCode = Process(
Seq(
java.getAbsolutePath,
"-Dsbt.override.build.repos=true",
s"-Dsbt.repository.config=${(base / "repositories").getAbsolutePath}",
s"-Dsbt.global.base=${globalBase.getAbsolutePath}",
s"-Dsbt.boot.directory=${(globalBase / "boot").getAbsolutePath}",
"-Dsbt.server.autostart=false",
"-jar",
launcher.getAbsolutePath,
"reload plugins",
"checkMetaBuildResolvers"
),
base / "nested"
).!
assert(exitCode == 0, s"nested sbt exited with status $exitCode")
}
)

View File

@ -0,0 +1,6 @@
val checkMetaBuildResolvers = taskKey[Unit]("Verifies the meta-build repository override")
checkMetaBuildResolvers := {
val names = csrResolvers.value.map(_.name).sorted
assert(names == Seq("internal-proxy", "local"), s"unexpected meta-build resolvers: $names")
}

View File

@ -0,0 +1,3 @@
[repositories]
local
internal-proxy: https://repo.maven.apache.org/maven2