Remove State out of progressReports

This commit is contained in:
Eugene Yokota 2019-05-03 16:44:42 -04:00
parent 668a0379eb
commit e8a22bf805
3 changed files with 5 additions and 6 deletions

View File

@ -296,7 +296,7 @@ object Defaults extends BuildCommon {
() => Clean.deleteContents(tempDirectory, _ => false)
},
useSuperShell := { if (insideCI.value) false else sbt.internal.TaskProgress.isEnabled },
progressReports := { (s: State) =>
progressReports := {
val progress = useSuperShell.value
val rs = EvaluateTask.taskTimingProgress.toVector ++
EvaluateTask.taskTraceEvent.toVector ++ {

View File

@ -234,14 +234,13 @@ object EvaluateTask {
structure: BuildStructure,
state: State
): ExecuteProgress[Task] = {
import Types.const
val maker: State => Seq[Keys.TaskProgress] = getSetting(
val maker: Seq[Keys.TaskProgress] = getSetting(
Keys.progressReports,
const(Seq()),
Seq(),
extracted,
structure
)
val reporters = maker(state) map { _.progress }
val reporters = maker map { _.progress }
// configure the logger for super shell
ConsoleAppender.setShowProgress((reporters collect {
case p: TaskProgress => ()

View File

@ -473,7 +473,7 @@ object Keys {
}
val useSuperShell = settingKey[Boolean]("Enables (true) or disables the super shell.")
// This key can be used to add custom ExecuteProgress instances
val progressReports = settingKey[State => Seq[TaskProgress]]("A function that returns a list of progress reporters.").withRank(DTask)
val progressReports = settingKey[Seq[TaskProgress]]("A function that returns a list of progress reporters.").withRank(DTask)
private[sbt] val postProgressReports = settingKey[Unit]("Internally used to modify logger.").withRank(DTask)
@deprecated("No longer used", "1.3.0")
private[sbt] val executeProgress = settingKey[State => TaskProgress]("Experimental task execution listener.").withRank(DTask)