mirror of https://github.com/sbt/sbt.git
Recover sbtOn
This commit is contained in:
parent
67e1e4a9ff
commit
1ec07c1867
|
|
@ -497,6 +497,7 @@ lazy val sbtProj = (project in file("sbt"))
|
|||
normalizedName := "sbt",
|
||||
crossScalaVersions := Seq(baseScalaVersion),
|
||||
crossPaths := false,
|
||||
javaOptions ++= Seq("-Xdebug", "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"),
|
||||
mimaSettings,
|
||||
mimaBinaryIssueFilters ++= sbtIgnoredProblems,
|
||||
BuildInfoPlugin.buildInfoDefaultSettings,
|
||||
|
|
@ -508,6 +509,9 @@ lazy val sbtProj = (project in file("sbt"))
|
|||
classDirectory in Compile,
|
||||
classDirectory in Test,
|
||||
),
|
||||
Test / run / connectInput := true,
|
||||
Test / run / outputStrategy := Some(StdoutOutput),
|
||||
Test / run / fork := true,
|
||||
)
|
||||
.configure(addSbtCompilerBridge)
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
package sbt
|
||||
|
||||
import scala.concurrent.Future
|
||||
import scala.util.Try
|
||||
import sbt.util.LogExchange
|
||||
import scala.annotation.tailrec
|
||||
import buildinfo.TestBuildInfo
|
||||
|
|
@ -17,21 +17,22 @@ object RunFromSourceMain {
|
|||
private val sbtVersion = "1.0.3" // "dev"
|
||||
private val scalaVersion = "2.12.4"
|
||||
|
||||
def fork(workingDirectory: File): Future[Unit] = {
|
||||
def fork(workingDirectory: File): Try[Unit] = {
|
||||
val fo = ForkOptions()
|
||||
.withWorkingDirectory(workingDirectory)
|
||||
.withOutputStrategy(OutputStrategy.StdoutOutput)
|
||||
fork(fo, workingDirectory)
|
||||
}
|
||||
|
||||
def fork(fo0: ForkOptions, workingDirectory: File): Try[Unit] = {
|
||||
val fo = fo0
|
||||
.withWorkingDirectory(workingDirectory)
|
||||
implicit val runner = new ForkRun(fo)
|
||||
val cp = {
|
||||
TestBuildInfo.test_classDirectory +: TestBuildInfo.fullClasspath
|
||||
}
|
||||
val options = Vector(workingDirectory.toString)
|
||||
val log = LogExchange.logger("RunFromSourceMain.fork", None, None)
|
||||
import scala.concurrent.ExecutionContext.Implicits.global
|
||||
Future {
|
||||
Run.run("sbt.RunFromSourceMain", cp, options, log)
|
||||
()
|
||||
}
|
||||
Run.run("sbt.RunFromSourceMain", cp, options, log)
|
||||
}
|
||||
|
||||
def main(args: Array[String]): Unit = args match {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,11 @@ case class TestServer(baseDirectory: File) {
|
|||
private val RetByte = '\r'.toByte
|
||||
|
||||
hostLog("fork to a new sbt instance")
|
||||
RunFromSourceMain.fork(baseDirectory)
|
||||
import scala.concurrent.ExecutionContext.Implicits.global
|
||||
Future {
|
||||
RunFromSourceMain.fork(baseDirectory)
|
||||
()
|
||||
}
|
||||
lazy val portfile = baseDirectory / "project" / "target" / "active.json"
|
||||
|
||||
hostLog("wait 30s until the server is ready to respond")
|
||||
|
|
|
|||
Loading…
Reference in New Issue