Fix #3160: Make actions/task-cancel compile

This commit is contained in:
jvican 2017-05-01 18:23:12 +02:00
parent 9d260f68c7
commit 293ae706f5
No known key found for this signature in database
GPG Key ID: 42DAFA0F112E8050
2 changed files with 7 additions and 7 deletions

View File

@ -1,9 +1,9 @@
import sbt.ExposeYourself._
taskCancelHandler := { (state: State) =>
new TaskEvaluationCancelHandler {
taskCancelStrategy := { (state: State) =>
new TaskCancellationStrategy {
type State = Unit
override def onTaskEngineStart(canceller: TaskCancel): Unit = canceller.cancel()
override def finish(result: Unit): Unit = ()
override def onTaskEngineStart(canceller: RunningTaskEngine): Unit = canceller.cancelAndShutdown()
override def onTaskEngineFinish(state: State): Unit = ()
}
}
}

View File

@ -1,5 +1,5 @@
package sbt // this API is private[sbt], so only exposed for trusted clients and folks who like breaking.
object ExposeYourself {
val taskCancelHandler = sbt.Keys.taskCancelHandler
}
val taskCancelStrategy = sbt.Keys.taskCancelStrategy
}