mirror of https://github.com/sbt/sbt.git
BuildStructure#root is SessionSettings#currentBuild
This commit is contained in:
parent
992b35af3c
commit
371f14d9a5
|
|
@ -74,7 +74,7 @@ private[sbt] final class CommandExchange {
|
|||
def onIncomingSocket(socket: Socket): Unit =
|
||||
{
|
||||
s.log.info(s"new client connected from: ${socket.getPort}")
|
||||
val channel = new NetworkChannel(newChannelName, socket, Project structure s, Project.session(s).currentBuild)
|
||||
val channel = new NetworkChannel(newChannelName, socket, Project structure s)
|
||||
subscribe(channel)
|
||||
channel.publishEventMessage(ChannelAcceptedEvent(channel.name))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@ package sbt
|
|||
package internal
|
||||
package server
|
||||
|
||||
import java.net.{ Socket, SocketTimeoutException, URI }
|
||||
import java.net.{ Socket, SocketTimeoutException }
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import sbt.protocol._
|
||||
import sjsonnew._
|
||||
|
||||
final class NetworkChannel(val name: String, connection: Socket, structure: BuildStructure, currentBuild: URI) extends CommandChannel {
|
||||
final class NetworkChannel(val name: String, connection: Socket, structure: BuildStructure) extends CommandChannel {
|
||||
private val running = new AtomicBoolean(true)
|
||||
private val delimiter: Byte = '\n'.toByte
|
||||
private val out = connection.getOutputStream
|
||||
|
|
@ -79,7 +79,7 @@ final class NetworkChannel(val name: String, connection: Socket, structure: Buil
|
|||
append(Exec(cmd.commandLine, cmd.execId orElse Some(Exec.newExecId), Some(CommandSource(name))))
|
||||
|
||||
private def onSettingQuery(req: SettingQuery) =
|
||||
StandardMain.exchange publishEventMessage SettingQuery.handleSettingQuery(req, structure, currentBuild)
|
||||
StandardMain.exchange publishEventMessage SettingQuery.handleSettingQuery(req, structure)
|
||||
|
||||
def shutdown(): Unit = {
|
||||
println("Shutting down client connection")
|
||||
|
|
|
|||
|
|
@ -66,10 +66,10 @@ object SettingQuery {
|
|||
): Parser[ScopedKey[_]] =
|
||||
scopedKeySelected(index, currentBuild, defaultConfigs, keyMap, data).map(_.key)
|
||||
|
||||
def scopedKeyParser(structure: BuildStructure, currentBuild: URI): Parser[ScopedKey[_]] =
|
||||
def scopedKeyParser(structure: BuildStructure): Parser[ScopedKey[_]] =
|
||||
scopedKey(
|
||||
structure.index.keyIndex,
|
||||
currentBuild,
|
||||
structure.root,
|
||||
structure.extra.configurationsForAxis,
|
||||
structure.index.keyMap,
|
||||
structure.data
|
||||
|
|
@ -89,8 +89,8 @@ object SettingQuery {
|
|||
def getSettingJsonStringValue[A](structure: BuildStructure, key: Def.ScopedKey[A]): Either[String, String] =
|
||||
getSettingValue(structure, key) map (toJsonString(_)(key.key.manifest))
|
||||
|
||||
def handleSettingQuery(req: SettingQuery, structure: BuildStructure, currentBuild: URI): SettingQueryResponse = {
|
||||
val key = Parser.parse(req.setting, scopedKeyParser(structure, currentBuild))
|
||||
def handleSettingQuery(req: SettingQuery, structure: BuildStructure): SettingQueryResponse = {
|
||||
val key = Parser.parse(req.setting, scopedKeyParser(structure))
|
||||
|
||||
val result: Either[String, String] = key flatMap (getSettingJsonStringValue(structure, _))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue