How to Get Information about Compilation Time for Each Target/Module in the Workspace
Opened this issue · 0 comments
mollyIV commented
We're trying to use the XCLogParser library to get information about compilation time for each target/module in our workspace.
Previously, we used the title and compilation duration properties like this:
let buildSteps = XcodeActivityLogAnalyzer().buildSteps(for: "App")
let names = buildSteps.map {
// The title says "Build target XYZ" where XYZ is the name of the target, for instance:
// Build target FrameworkA
$0.title.split(separator: " ").last ?? $0.title
}
let compilationDurations = buildSteps.map { $0.compilationDuration }
let targets = Dictionary(
zip(names, compilationDurations),
uniquingKeysWith: { max($0, $1) }
)
However, this stopped working after we switched to Xcode 16 and integrated a Swift macro module. Now, all targets are showing a compilation duration of 0.
We can provide a POC if needed.
Using the solution from XCLogParser HtmlReporter doesn't work for us because it shows incorrect targets in the HTML report and uses duration
instead of compilationDuration
for charts.
Can you recommend a proper way to get accurate compilation times for each target/module in the workspace?