Skip to content

Commit 7fb7c6d

Browse files
authored
improve build complete message (#3825)
motivation: when no work needs to be done the output is [0/0] Build complete! which is confusing changes: treat the build complete step as a descrete step incrementing the step + total counts
1 parent 0e50a04 commit 7fb7c6d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Sources/Build/BuildOperationBuildSystemDelegateHandler.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -621,13 +621,12 @@ final class BuildOperationBuildSystemDelegateHandler: LLBuildBuildSystemDelegate
621621

622622
func buildComplete(success: Bool) {
623623
queue.sync {
624+
self.progressAnimation.complete(success: success)
624625
if success {
625-
self.progressAnimation.update(
626-
step: self.taskTracker.finishedCount,
627-
total: self.taskTracker.totalCount,
628-
text: "Build complete!")
626+
self.progressAnimation.clear()
627+
self.outputStream <<< "Build complete!\n"
628+
self.outputStream.flush()
629629
}
630-
self.progressAnimation.complete(success: success)
631630
}
632631
}
633632

Tests/CommandsTests/BuildToolTests.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,14 @@ final class BuildToolTests: XCTestCase {
273273
do {
274274
let result = try execute([], packagePath: path)
275275
// Number of steps must be greater than 0. e.g., [8/8] Build complete!
276-
XCTAssertMatch(result.stdout, .regex("\\[[1-9][0-9]*\\/[1-9][0-9]*\\] Build complete!"))
276+
XCTAssertMatch(result.stdout, .regex("\\[[1-9][0-9]*\\/[1-9][0-9]*\\] Linking Foo"))
277+
XCTAssertMatch(result.stdout, .suffix("\nBuild complete!\n"))
277278
}
278279

279280
do {
280281
let result = try execute([], packagePath: path)
281282
// test second time, to make sure message is presented even when nothing to build (cached)
282-
XCTAssertMatch(result.stdout, .contains("[0/0] Build complete!"))
283+
XCTAssertMatch(result.stdout, .equal("[1/1] Planning build\nBuild complete!\n"))
283284
}
284285
}
285286
}

0 commit comments

Comments
 (0)