mirror of https://github.com/sbt/sbt.git
Experimental task progress interface. Fixes #592.
Set sbt.task.timings=true to print timings for tasks. This sample progress handler shows how to get names for tasks and deal with flatMapped tasks. There are still some tasks that make it through as anonymous, which needs to be investigated. A setting to provide a custom handler should come in a subsequent commit.
This commit is contained in:
parent
e7cdcc2deb
commit
f47ad3fb72
|
|
@ -12,6 +12,7 @@ trait IDSet[T]
|
|||
def ++=(t: Iterable[T]): Unit
|
||||
def -= (t: T): Boolean
|
||||
def all: collection.Iterable[T]
|
||||
def toList: List[T]
|
||||
def isEmpty: Boolean
|
||||
def foreach(f: T => Unit): Unit
|
||||
def process[S](t: T)(ifSeen: S)(ifNew: => S): S
|
||||
|
|
@ -38,6 +39,7 @@ object IDSet
|
|||
def ++=(t: Iterable[T]) = t foreach +=
|
||||
def -= (t:T) = if(backing.remove(t) eq null) false else true
|
||||
def all = collection.JavaConversions.collectionAsScalaIterable(backing.keySet)
|
||||
def toList = all.toList
|
||||
def isEmpty = backing.isEmpty
|
||||
def process[S](t: T)(ifSeen: S)(ifNew: => S) = if(contains(t)) ifSeen else { this += t ; ifNew }
|
||||
override def toString = backing.toString
|
||||
|
|
|
|||
Loading…
Reference in New Issue