mirror of https://github.com/sbt/sbt.git
Merge pull request #8051 from eed3si9n/wip/revert-run-switching
[1.x] Revert run switching on 1.x
This commit is contained in:
commit
0c1fd9aff7
|
|
@ -148,21 +148,6 @@ final class NetworkChannel(
|
||||||
self.onCancellationRequest(execId, crp)
|
self.onCancellationRequest(execId, crp)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Take over commandline for network channel
|
|
||||||
private val networkCommand: PartialFunction[String, String] = {
|
|
||||||
case cmd if cmd.split(" ").head.split("/").last == "run" =>
|
|
||||||
s"clientJob $cmd"
|
|
||||||
}
|
|
||||||
override protected def appendExec(commandLine: String, execId: Option[String]): Boolean =
|
|
||||||
if (clientCanWork && networkCommand.isDefinedAt(commandLine))
|
|
||||||
super.appendExec(networkCommand(commandLine), execId)
|
|
||||||
else super.appendExec(commandLine, execId)
|
|
||||||
|
|
||||||
override private[sbt] def onCommandLine(cmd: String): Boolean =
|
|
||||||
if (clientCanWork && networkCommand.isDefinedAt(cmd))
|
|
||||||
appendExec(networkCommand(cmd), None)
|
|
||||||
else super.onCommandLine(cmd)
|
|
||||||
|
|
||||||
protected def setInitializeOption(opts: InitializeOption): Unit = initializeOption.set(opts)
|
protected def setInitializeOption(opts: InitializeOption): Unit = initializeOption.set(opts)
|
||||||
|
|
||||||
// Returns true if sbtn has declared with canWork: true
|
// Returns true if sbtn has declared with canWork: true
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ object ClientTest extends AbstractServerTest {
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
private def clientWithStdoutLines(args: String*): (Int, Seq[String]) = {
|
def clientWithStdoutLines(args: String*): (Int, Seq[String]) = {
|
||||||
val out = new CachingPrintStream
|
val out = new CachingPrintStream
|
||||||
val exitCode = background(
|
val exitCode = background(
|
||||||
NetworkClient.client(
|
NetworkClient.client(
|
||||||
|
|
@ -120,11 +120,6 @@ object ClientTest extends AbstractServerTest {
|
||||||
test("three commands with middle failure") { _ =>
|
test("three commands with middle failure") { _ =>
|
||||||
assert(client("compile;willFail;willSucceed") == 1)
|
assert(client("compile;willFail;willSucceed") == 1)
|
||||||
}
|
}
|
||||||
test("run") { _ =>
|
|
||||||
val (exitCode, lines) = clientWithStdoutLines("run")
|
|
||||||
assert(exitCode == 0)
|
|
||||||
assert(lines.toList.exists(_.endsWith("Hello, World!")))
|
|
||||||
}
|
|
||||||
test("compi completions") { _ =>
|
test("compi completions") { _ =>
|
||||||
val expected = Vector(
|
val expected = Vector(
|
||||||
"compile",
|
"compile",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue