mirror of https://github.com/sbt/sbt.git
merge two Tasked methods
In practice, the returned task is coupled to the conversion function, so task and taskToNode were merged. Also, renamed 'task' to 'act'.
This commit is contained in:
parent
44c49ab531
commit
23bf3e55c7
|
|
@ -86,8 +86,7 @@ trait Member[Node <: Member[Node]]
|
|||
trait Tasked
|
||||
{
|
||||
type Task[T] <: AnyRef
|
||||
def task(name: String, state: State): Option[Task[State]]
|
||||
implicit def taskToNode: NodeView[Task]
|
||||
def act(in: Input, state: State): Option[(Task[State], NodeView[Task])]
|
||||
def help: Seq[Help]
|
||||
}
|
||||
trait TaskSetup
|
||||
|
|
|
|||
|
|
@ -200,8 +200,8 @@ object Commands
|
|||
case c: TaskSetup => (c.checkCycles, c.maxThreads)
|
||||
case _ => (false, Runtime.getRuntime.availableProcessors)
|
||||
}
|
||||
for(task <- p.task(in.name, s)) yield
|
||||
processResult(runTask(task, checkCycles, maxThreads)(p.taskToNode), s)
|
||||
for( (task, taskToNode) <- p.act(in, s)) yield
|
||||
processResult(runTask(task, checkCycles, maxThreads)(taskToNode), s)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue