mirror of https://github.com/sbt/sbt.git
Updated Server Build level API (markdown)
parent
de607d2888
commit
1704580af4
|
|
@ -13,14 +13,16 @@ val uiContext = taskKey[sbt.UIContext]("All user interaction should be driven th
|
||||||
|
|
||||||
```scala
|
```scala
|
||||||
package sbt
|
package sbt
|
||||||
trait UIContext {
|
sealed trait UIContext {
|
||||||
|
|
||||||
/** Prompts the user for input, optionally with a mask for characters. */
|
/** 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. */
|
/** Sends an event out to all registered event listeners. */
|
||||||
def sendEvent[T: Format](event: T): Unit
|
def sendEvent[T: Format](event: T): Unit
|
||||||
|
def sendGenericEvent(data: JsValue): Unit
|
||||||
}
|
}
|
||||||
|
private[sbt] abstract class AbstractUIContext extends UIContext
|
||||||
```
|
```
|
||||||
|
|
||||||
# 3. Plugin API
|
# 3. Plugin API
|
||||||
|
|
@ -29,6 +31,11 @@ trait UIContext {
|
||||||
trait Plugin {
|
trait Plugin {
|
||||||
...
|
...
|
||||||
def serializers: Seq[(AttributeKey[_], Format[_])] = Nil
|
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]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue