Updated Server Build level API (markdown)

Josh Suereth 2014-01-15 12:31:43 -08:00
parent de607d2888
commit 1704580af4
1 changed files with 10 additions and 3 deletions

@ -13,14 +13,16 @@ val uiContext = taskKey[sbt.UIContext]("All user interaction should be driven th
```scala
package sbt
trait UIContext {
sealed trait UIContext {
/** Prompts the user for input, optionally with a mask for characters. */
def readLine(prompt: String, mask: Option[Char] = None): Option[String]
def readLine(prompt: String, mask: Boolean): Option[String]
// TODO - Ask for input with autocomplete?
/** Sends an event out to all registered event listeners. */
def sendEvent[T: Format](event: T): Unit
def sendGenericEvent(data: JsValue): Unit
}
private[sbt] abstract class AbstractUIContext extends UIContext
```
# 3. Plugin API
@ -29,6 +31,11 @@ trait UIContext {
trait Plugin {
...
def serializers: Seq[(AttributeKey[_], Format[_])] = Nil
// Example types for keys....
// TaskKey[T] => AttributeKey[Task[T]] -> Format[T]
// SettingKey[T] => AttributeKey[T] -> Format[T]
// InputKey[T] => AttributeKey[InputTask[T]] -> Format[T]
}
```