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