Initial cut at client-level server API

Josh Suereth 2014-01-15 11:51:46 -08:00
parent 7fe6f29b5c
commit 797f96c041
1 changed files with 31 additions and 0 deletions

@ -0,0 +1,31 @@
The server aspects to sbt build will be exposed to build/plugin authors as follows:
1. A new key available which can be used to interact with the server:
```scala
val uiContext = taskKey[sbt.UIContext]("All user interaction should be driven through this interface.")
```
2. A new interface:
```scala
package sbt
trait UIContext {
/** Prompts the user for input, optionally with a mask for characters. */
def readLine(prompt: String, mask: Option[Char] = None): Option[String]
/** Sends an event out to all registered event listeners. */
def sendEvent[T: Format](event: T): Unit
}
```
3. An addition to plugin API:
```scala
trait Plugin {
def serializers: Seq[(AttributeKey[_], Format[_])] = Nil
}
```
# TODO - More information about the changes...