Merge pull request #4647 from eed3si9n/wip/progress

Remove State out of progressReports
This commit is contained in:
eugene yokota 2019-05-03 17:51:51 -04:00 committed by GitHub
commit f5edeec2fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 7 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)

View File

@ -1 +1 @@
sbt.version=1.3.0-M2
sbt.version=1.3.0-M3