From 797f96c041499a10972111ee9070d8c46181b5c5 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Wed, 15 Jan 2014 11:51:46 -0800 Subject: [PATCH] Initial cut at client-level server API --- Server---Build-level-API.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Server---Build-level-API.md diff --git a/Server---Build-level-API.md b/Server---Build-level-API.md new file mode 100644 index 0000000..de57194 --- /dev/null +++ b/Server---Build-level-API.md @@ -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... \ No newline at end of file