mirror of https://github.com/sbt/sbt.git
[2.0.x] restore JVM option capability in the launcher config (#9452)
Restores override-build-repos config option responsible for passing the JVM flag to the launcher.
This commit is contained in:
parent
c987acd3da
commit
bd58413122
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
}
|
||||
)
|
||||
|
|
@ -0,0 +1 @@
|
|||
name := "nested"
|
||||
|
|
@ -0,0 +1 @@
|
|||
sbt.version=1.12.11
|
||||
|
|
@ -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")
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
[repositories]
|
||||
local
|
||||
internal-proxy: https://repo.maven.apache.org/maven2
|
||||
|
|
@ -0,0 +1 @@
|
|||
> check
|
||||
Loading…
Reference in New Issue