mirror of https://github.com/sbt/sbt.git
Initial cut at client-level server API
parent
7fe6f29b5c
commit
797f96c041
|
|
@ -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...
|
||||
Loading…
Reference in New Issue