Merge pull request #3813 from dwijnand/add-project-id-to-watching-message

Add project id to watching message
This commit is contained in:
eugene yokota 2017-12-18 20:06:14 -05:00 committed by GitHub
commit b21d0e11fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 4 deletions

View File

@ -44,8 +44,13 @@ trait Watched {
}
object Watched {
val defaultWatchingMessage
: WatchState => String = _.count + ". Waiting for source changes... (press enter to interrupt)"
val defaultWatchingMessage: WatchState => String = ws =>
s"${ws.count}. Waiting for source changes... (press enter to interrupt)"
def projectWatchingMessage(projectId: String): WatchState => String =
ws =>
s"${ws.count}. Waiting for source changes in project $projectId... (press enter to interrupt)"
val defaultTriggeredMessage: WatchState => String = const("")
val clearWhenTriggered: WatchState => String = const(clearScreen)
def clearScreen: String = "\u001b[2J\u001b[0;0H"
@ -70,8 +75,8 @@ object Watched {
* @param base The base directory from which to include files.
* @return An instance of `Source`.
*/
def apply(base: File): Source =
apply(base, AllPassFilter, NothingFilter)
def apply(base: File): Source = apply(base, AllPassFilter, NothingFilter)
}
private[this] class AWatched extends Watched

View File

@ -530,6 +530,7 @@ object Defaults extends BuildCommon {
clean := (Def.task { IO.delete(cleanFiles.value) } tag (Tags.Clean)).value,
consoleProject := consoleProjectTask.value,
watchTransitiveSources := watchTransitiveSourcesTask.value,
watchingMessage := Watched.projectWatchingMessage(thisProjectRef.value.project),
watch := watchSetting.value
)

View File

@ -0,0 +1,12 @@
[@dwijnand]: https://github.com/dwijnand
[#2038]: https://github.com/sbt/sbt/issues/2038
[#3813]: https://github.com/sbt/sbt/pull/3813
### Fixes with compatibility implications
### Improvements
- Add the current project's id to `~`'s watching message. [#2038][]/[#3813][] by [@dwijnand][]
### Bug fixes