From cddbb8dd12c26ac9f29dd1b381dbd956cea2c0a1 Mon Sep 17 00:00:00 2001 From: Gerolf Seitz Date: Mon, 7 May 2012 21:56:40 +0200 Subject: [PATCH] Add method Aggregation.runTasksWithResult --- main/Aggregation.scala | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/main/Aggregation.scala b/main/Aggregation.scala index 44df95bff..ee6125898 100644 --- a/main/Aggregation.scala +++ b/main/Aggregation.scala @@ -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._ @@ -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