Skip to content

Commit 1ba7b6a

Browse files
authored
Merge pull request #80152 from compnerd/timing
utils: improve timing data collection for build.ps1
2 parents 77dd7e2 + 1e74bdf commit 1ba7b6a

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

utils/build.ps1

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ function Invoke-BuildStep([string] $Name) {
529529
& $Name @Args
530530

531531
if ($Summary) {
532-
Add-TimingData $BuildStepArch $BuildStepPlatform ($Name -replace "Build-","") $Stopwatch.Elapsed
532+
Add-TimingData $BuildStepArch $BuildStepPlatform $Name $Stopwatch.Elapsed
533533
}
534534
if ($Name.Replace("Build-", "") -eq $BuildTo) {
535535
exit 0
@@ -1454,7 +1454,8 @@ enum SPMBuildAction {
14541454

14551455
function Build-SPMProject {
14561456
[CmdletBinding(PositionalBinding = $false)]
1457-
param(
1457+
param
1458+
(
14581459
[SPMBuildAction] $Action,
14591460
[string] $Src,
14601461
[string] $Bin,
@@ -1525,10 +1526,6 @@ function Build-SPMProject {
15251526
Write-Host -ForegroundColor Cyan "[$([DateTime]::Now.ToString("yyyy-MM-dd HH:mm:ss"))] Finished building '$Src' to '$Bin' in $($Stopwatch.Elapsed)"
15261527
Write-Host ""
15271528
}
1528-
1529-
if ($Summary) {
1530-
Add-TimingData $BuildArch.LLVMName "Windows" $Src.Replace($SourceCache, '') $Stopwatch.Elapsed
1531-
}
15321529
}
15331530

15341531
function Build-WiXProject() {
@@ -3295,22 +3292,24 @@ if (-not $IsCrossCompiling) {
32953292
"-TestLLVM" = $Test -contains "llvm";
32963293
"-TestSwift" = $Test -contains "swift";
32973294
}
3295+
# FIXME(compnerd) this involves fixing the specialised argument handling in
3296+
# `Invoke-BuildStep` to deal with the additional boolean parameters.
32983297
Build-Compilers $HostArch @Tests
32993298
}
33003299

3301-
if ($Test -contains "dispatch") { Test-Dispatch }
3302-
if ($Test -contains "foundation") { Test-Foundation }
3303-
if ($Test -contains "xctest") { Test-XCTest }
3304-
if ($Test -contains "testing") { Test-Testing }
3305-
if ($Test -contains "llbuild") { Test-LLBuild }
3306-
if ($Test -contains "swiftpm") { Test-PackageManager }
3307-
if ($Test -contains "swift-format") { Test-Format }
3308-
if ($Test -contains "sourcekit-lsp") { Test-SourceKitLSP }
3300+
if ($Test -contains "dispatch") { Invoke-BuildStep Test-Dispatch }
3301+
if ($Test -contains "foundation") { Invoke-BuildStep Test-Foundation }
3302+
if ($Test -contains "xctest") { Invoke-BuildStep Test-XCTest }
3303+
if ($Test -contains "testing") { Invoke-BuildStep Test-Testing }
3304+
if ($Test -contains "llbuild") { Invoke-BuildStep Test-LLBuild }
3305+
if ($Test -contains "swiftpm") { Invoke-BuildStep Test-PackageManager }
3306+
if ($Test -contains "swift-format") { Invoke-BuildStep Test-Format }
3307+
if ($Test -contains "sourcekit-lsp") { Invoke-BuildStep Test-SourceKitLSP }
33093308

33103309
if ($Test -contains "swift") {
33113310
foreach ($Arch in $AndroidSDKArchs) {
33123311
try {
3313-
Test-Runtime Android $Arch
3312+
Invoke-BuildStep Test-Runtime Android $Arch
33143313
} catch {}
33153314
}
33163315
}

0 commit comments

Comments
 (0)