@@ -183,7 +183,9 @@ public final class BuildDelegate: BuildSystemDelegate {
183
183
return completedCount + scanningCount - upToDateCount
184
184
}
185
185
186
- mutating func update( withStatusChange kind: CommandStatusKind ) {
186
+ mutating func update( command: SPMLLBuild . Command , kind: CommandStatusKind ) {
187
+ guard command. shouldShowStatus else { return }
188
+
187
189
switch kind {
188
190
case . isScanning:
189
191
scanningCount += 1
@@ -204,7 +206,6 @@ public final class BuildDelegate: BuildSystemDelegate {
204
206
public var isVerbose : Bool = false
205
207
public var onCommmandFailure : ( ( ) -> Void ) ?
206
208
private var commandCounter = CommandCounter ( )
207
- private var lastProgressDescription : String = " "
208
209
private let queue = DispatchQueue ( label: " org.swift.swiftpm.build-delegate " )
209
210
210
211
public init (
@@ -237,29 +238,22 @@ public final class BuildDelegate: BuildSystemDelegate {
237
238
238
239
public func commandStatusChanged( _ command: SPMLLBuild . Command , kind: CommandStatusKind ) {
239
240
queue. sync {
240
- commandCounter. update ( withStatusChange : kind)
241
+ commandCounter. update ( command : command , kind : kind)
241
242
}
242
243
}
243
244
244
245
public func commandPreparing( _ command: SPMLLBuild . Command ) {
245
246
}
246
247
247
248
public func commandStarted( _ command: SPMLLBuild . Command ) {
249
+ guard command. shouldShowStatus else { return }
250
+
248
251
queue. sync {
249
252
commandCounter. startedCount += 1
250
-
251
- let description : String
252
- if command. shouldShowStatus {
253
- description = isVerbose ? command. verboseDescription : command. description
254
- } else {
255
- description = lastProgressDescription
256
- }
257
-
258
- lastProgressDescription = description
259
253
progressAnimation. update (
260
254
step: commandCounter. startedCount,
261
255
total: commandCounter. estimatedMaximum,
262
- text: description)
256
+ text: isVerbose ? command . verboseDescription : command . description)
263
257
}
264
258
}
265
259
@@ -303,7 +297,7 @@ public final class BuildDelegate: BuildSystemDelegate {
303
297
304
298
public func commandProcessHadOutput( _ command: SPMLLBuild . Command , process: ProcessHandle , data: [ UInt8 ] ) {
305
299
progressAnimation. clear ( )
306
- outputStream <<< ( data + [ newLineByte ] )
300
+ outputStream <<< data
307
301
outputStream. flush ( )
308
302
}
309
303
0 commit comments