mirror of https://github.com/sbt/sbt.git
Fix task progress blank line behavior
Run readyLog lazily.
This commit is contained in:
parent
d58b302a97
commit
b00dcb1b9d
|
|
@ -29,6 +29,7 @@ private[sbt] final class TaskProgress(currentRef: ProjectRef) extends ExecutePro
|
||||||
private[this] val calledBy = new ConcurrentHashMap[Task[_], Task[_]]
|
private[this] val calledBy = new ConcurrentHashMap[Task[_], Task[_]]
|
||||||
private[this] val anonOwners = new ConcurrentHashMap[Task[_], Task[_]]
|
private[this] val anonOwners = new ConcurrentHashMap[Task[_], Task[_]]
|
||||||
private[this] val isReady = new AtomicBoolean(false)
|
private[this] val isReady = new AtomicBoolean(false)
|
||||||
|
private[this] val isLogReady = new AtomicBoolean(false)
|
||||||
private[this] val isAllCompleted = new AtomicBoolean(false)
|
private[this] val isAllCompleted = new AtomicBoolean(false)
|
||||||
|
|
||||||
override def initial: Unit = ()
|
override def initial: Unit = ()
|
||||||
|
|
@ -75,7 +76,6 @@ private[sbt] final class TaskProgress(currentRef: ProjectRef) extends ExecutePro
|
||||||
Thread.sleep(500)
|
Thread.sleep(500)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
readyLog()
|
|
||||||
while (!isAllCompleted.get) {
|
while (!isAllCompleted.get) {
|
||||||
blocking {
|
blocking {
|
||||||
report()
|
report()
|
||||||
|
|
@ -86,13 +86,16 @@ private[sbt] final class TaskProgress(currentRef: ProjectRef) extends ExecutePro
|
||||||
|
|
||||||
private[this] val console = ConsoleOut.systemOut
|
private[this] val console = ConsoleOut.systemOut
|
||||||
private[this] def readyLog(): Unit = {
|
private[this] def readyLog(): Unit = {
|
||||||
console.println("")
|
if (isLogReady.get) ()
|
||||||
console.println("")
|
else {
|
||||||
console.println("")
|
console.println("")
|
||||||
console.println("")
|
console.println("")
|
||||||
console.println("")
|
console.println("")
|
||||||
console.println("")
|
console.println("")
|
||||||
console.print(CursorUp5)
|
console.println("")
|
||||||
|
console.print(CursorUp5)
|
||||||
|
isLogReady.set(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private[this] val stopReportTask =
|
private[this] val stopReportTask =
|
||||||
|
|
@ -100,6 +103,7 @@ private[sbt] final class TaskProgress(currentRef: ProjectRef) extends ExecutePro
|
||||||
private[this] def report(): Unit = console.lockObject.synchronized {
|
private[this] def report(): Unit = console.lockObject.synchronized {
|
||||||
val currentTasks = activeTasks.asScala.toList
|
val currentTasks = activeTasks.asScala.toList
|
||||||
def report0: Unit = {
|
def report0: Unit = {
|
||||||
|
readyLog()
|
||||||
console.print(s"$CursorDown1")
|
console.print(s"$CursorDown1")
|
||||||
currentTasks foreach {
|
currentTasks foreach {
|
||||||
case (task, start) =>
|
case (task, start) =>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue