Forward -Dsbt.ivy.home

This commit is contained in:
Eugene Yokota
2019-12-30 04:58:21 -05:00
parent f5090cf70f
commit 4d8c8b8e34
2 changed files with 18 additions and 3 deletions
+10 -2
View File
@@ -1201,7 +1201,11 @@ def otherRootSettings =
scriptedUnpublished := scriptedUnpublishedTask.evaluated, scriptedUnpublished := scriptedUnpublishedTask.evaluated,
scriptedSource := (sourceDirectory in sbtProj).value / "sbt-test", scriptedSource := (sourceDirectory in sbtProj).value / "sbt-test",
watchTriggers in scripted += scriptedSource.value.toGlob / **, 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 }, publishAll := { val _ = (publishLocal).all(ScopeFilter(inAnyProject)).value },
publishLocalBinAll := { val _ = (publishLocalBin).all(ScopeFilter(inAnyProject)).value }, publishLocalBinAll := { val _ = (publishLocalBin).all(ScopeFilter(inAnyProject)).value },
aggregate in bintrayRelease := false aggregate in bintrayRelease := false
@@ -1213,7 +1217,11 @@ def otherRootSettings =
"-server", "-server",
"-Dsbt.override.build.repos=true", "-Dsbt.override.build.repos=true",
s"""-Dsbt.repository.config=${scriptedSource.value / "repo.config"}""" 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, scripted := scriptedTask.evaluated,
scriptedUnpublished := scriptedUnpublishedTask.evaluated, scriptedUnpublished := scriptedUnpublishedTask.evaluated,
scriptedSource := (sourceDirectory in sbtProj).value / "repo-override-test" scriptedSource := (sourceDirectory in sbtProj).value / "repo-override-test"
@@ -26,6 +26,10 @@ object RunFromSourceMain {
def fork(fo0: ForkOptions, workingDirectory: File): Process = { def fork(fo0: ForkOptions, workingDirectory: File): Process = {
val fo = fo0 val fo = fo0
.withWorkingDirectory(workingDirectory) .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) implicit val runner = new ForkRun(fo)
val cp = { val cp = {
TestBuildInfo.test_classDirectory +: TestBuildInfo.fullClasspath TestBuildInfo.test_classDirectory +: TestBuildInfo.fullClasspath
@@ -117,7 +121,10 @@ object RunFromSourceMain {
def topLoader = new java.net.URLClassLoader(Array(), null) def topLoader = new java.net.URLClassLoader(Array(), null)
def globalLock = noGlobalLock def globalLock = noGlobalLock
def bootDirectory = RunFromSourceMain.bootDirectory 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 case class PredefRepo(id: Predefined) extends PredefinedRepository
import Predefined._ import Predefined._
def ivyRepositories = Array(PredefRepo(Local), PredefRepo(MavenCentral)) def ivyRepositories = Array(PredefRepo(Local), PredefRepo(MavenCentral))