Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Sources/SwiftBuildSupport/SwiftBuildSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,6 @@ public final class SwiftBuildSystem: SPMBuildCore.BuildSystem {
switch operation.state {
case .succeeded:
guard !self.logLevel.isQuiet else { return }
buildMessageHandler.progressAnimation.update(step: 100, total: 100, text: "")
buildMessageHandler.progressAnimation.complete(success: true)
let duration = ContinuousClock.Instant.now - buildStartTime
let formattedDuration = duration.formatted(.units(allowed: [.seconds], fractionalPart: .show(length: 2, rounded: .up)))
Expand Down
10 changes: 4 additions & 6 deletions Sources/SwiftBuildSupport/SwiftBuildSystemMessageHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,15 @@ public final class SwiftBuildSystemMessageHandler {
}
}
case .didUpdateProgress(let progressInfo):
let step = Int(progressInfo.percentComplete)
let message = if let targetName = progressInfo.targetName {
"\(targetName) \(progressInfo.message)"
"[\(progressInfo.message)] \(targetName)"
} else {
"\(progressInfo.message)"
"[\(progressInfo.message)]"
}

// Skip if message doesn't contain anything useful to display.
// TODO: To file an issue for SwiftBuild here.
if message.contains(where: \.isLetter) {
progressAnimation.update(step: step, total: 100, text: message)
if !message.isEmpty {
progressAnimation.update(step: -1, total: 100, text: message)
}

callback = { [weak self] buildSystem in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,10 @@ struct SwiftBuildSystemMessageHandlerTests {
#expect(self.observability.diagnostics.count == 0)

let output = self.outputStream.bytes.description
#expect(output.contains("Weird percent"))
#expect(!output.contains("12 / 32"))
#expect(output.contains("Something useful"))
#expect(output.contains("Complete"))
#expect(output.contains("[Weird percent]"))
#expect(output.contains("[12 / 32]"))
#expect(output.contains("[Something useful]"))
#expect(output.contains("[Complete]"))
}
}

Expand Down
Loading