Skip to content

Commit

Permalink
Add method Aggregation.runTasksWithResult
Browse files Browse the repository at this point in the history
  • Loading branch information
gseitz authored and harrah committed May 7, 2012
1 parent fdf9be1 commit cddbb8d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions main/Aggregation.scala
Expand Up @@ -30,7 +30,7 @@ final object Aggregation
Command.applyEffect(seqParser(ps)) { ts =>
runTasks(s, structure, ts, Dummies(KNil, HNil), show)
}
def runTasks[HL <: HList, T](s: State, structure: Load.BuildStructure, ts: Values[Task[T]], extra: Dummies[HL], show: Boolean)(implicit display: Show[ScopedKey[_]]): State =
def runTasksWithResult[HL <: HList, T](s: State, structure: Load.BuildStructure, ts: Values[Task[T]], extra: Dummies[HL], show: Boolean)(implicit display: Show[ScopedKey[_]]): (State, Result[Seq[KeyValue[T]]]) =
{
import EvaluateTask._
import std.TaskExtra._
Expand All @@ -52,10 +52,15 @@ final object Aggregation
try { onResult(result, log) { results => if(show) printSettings(results, log) } }
finally { printSuccess(start, stop, extracted, success, log) }

newS
(newS, result)
}

def printSuccess(start: Long, stop: Long, extracted: Extracted, success: Boolean, log: Logger)
def runTasks[HL <: HList, T](s: State, structure: Load.BuildStructure, ts: Values[Task[T]], extra: Dummies[HL], show: Boolean)(implicit display: Show[ScopedKey[_]]): State = {
runTasksWithResult(s, structure, ts, extra, show)._1
}


def printSuccess(start: Long, stop: Long, extracted: Extracted, success: Boolean, log: Logger)
{
import extracted._
lazy val enabled = showSuccess in extracted.currentRef get extracted.structure.data getOrElse true
Expand Down

0 comments on commit cddbb8d

Please sign in to comment.