From f47ad3fb723d861f98e83b98ba9a9207a91a3382 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Sun, 23 Jun 2013 19:57:30 -0400 Subject: [PATCH] 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. --- util/collection/src/main/scala/sbt/IDSet.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/collection/src/main/scala/sbt/IDSet.scala b/util/collection/src/main/scala/sbt/IDSet.scala index 447082d8b..43a0d6f16 100644 --- a/util/collection/src/main/scala/sbt/IDSet.scala +++ b/util/collection/src/main/scala/sbt/IDSet.scala @@ -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