Forward -Dsbt.ivy.home

This commit is contained in:
Eugene Yokota 2019-12-29 19:26:05 -05:00
parent f5090cf70f
commit 4d8c8b8e34
2 changed files with 18 additions and 3 deletions

View File

@ -1201,7 +1201,11 @@ def otherRootSettings =
scriptedUnpublished := scriptedUnpublishedTask.evaluated,
scriptedSource := (sourceDirectory in sbtProj).value / "sbt-test",
watchTriggers in scripted += scriptedSource.value.toGlob / **,
scriptedLaunchOpts := List("-Xmx1500M", "-Xms512M", "-server"),
scriptedLaunchOpts := List("-Xmx1500M", "-Xms512M", "-server") :::
(sys.props.get("sbt.ivy.home") match {
case Some(home) => List(s"-Dsbt.ivy.home=$home")
case _ => Nil
}),
publishAll := { val _ = (publishLocal).all(ScopeFilter(inAnyProject)).value },
publishLocalBinAll := { val _ = (publishLocalBin).all(ScopeFilter(inAnyProject)).value },
aggregate in bintrayRelease := false
@ -1213,7 +1217,11 @@ def otherRootSettings =
"-server",
"-Dsbt.override.build.repos=true",
s"""-Dsbt.repository.config=${scriptedSource.value / "repo.config"}"""
),
) :::
(sys.props.get("sbt.ivy.home") match {
case Some(home) => List(s"-Dsbt.ivy.home=$home")
case _ => Nil
}),
scripted := scriptedTask.evaluated,
scriptedUnpublished := scriptedUnpublishedTask.evaluated,
scriptedSource := (sourceDirectory in sbtProj).value / "repo-override-test"

View File

@ -26,6 +26,10 @@ object RunFromSourceMain {
def fork(fo0: ForkOptions, workingDirectory: File): Process = {
val fo = fo0
.withWorkingDirectory(workingDirectory)
.withRunJVMOptions(sys.props.get("sbt.ivy.home") match {
case Some(home) => Vector(s"-Dsbt.ivy.home=$home")
case _ => Vector()
})
implicit val runner = new ForkRun(fo)
val cp = {
TestBuildInfo.test_classDirectory +: TestBuildInfo.fullClasspath
@ -117,7 +121,10 @@ object RunFromSourceMain {
def topLoader = new java.net.URLClassLoader(Array(), null)
def globalLock = noGlobalLock
def bootDirectory = RunFromSourceMain.bootDirectory
def ivyHome = file(sys.props("user.home")) / ".ivy2"
def ivyHome: File = sys.props.get("sbt.ivy.home") match {
case Some(home) => file(home)
case _ => file(sys.props("user.home")) / ".ivy2"
}
case class PredefRepo(id: Predefined) extends PredefinedRepository
import Predefined._
def ivyRepositories = Array(PredefRepo(Local), PredefRepo(MavenCentral))