Quiet platform and Apple validation wrappers
This commit is contained in:
@@ -13,7 +13,12 @@ param(
|
||||
[string]$LogDir = "out/logs/quiet-validation",
|
||||
[string]$IgnoreFilterFile = "",
|
||||
[string[]]$IgnorePattern = @(),
|
||||
[int]$FailureTailLines = 0
|
||||
[int]$FailureTailLines = 0,
|
||||
[switch]$IncludePlatformBuild,
|
||||
[string[]]$PlatformBuildPresets = @("android-arm64", "android-x64", "android-quest-arm64", "android-focus-arm64"),
|
||||
[string[]]$PlatformBuildTargets = @(),
|
||||
[switch]$IncludeAppleRemote,
|
||||
[string[]]$AppleRemotePresets = @("macos", "ios-simulator", "ios-device")
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
@@ -179,6 +184,12 @@ function Invoke-QuietStep {
|
||||
|
||||
$started = Get-Date
|
||||
$exitCode = 0
|
||||
$restoreNativeCommandPreference = $false
|
||||
if (Get-Variable -Name PSNativeCommandUseErrorActionPreference -ErrorAction SilentlyContinue) {
|
||||
$previousNativeCommandPreference = $PSNativeCommandUseErrorActionPreference
|
||||
$PSNativeCommandUseErrorActionPreference = $false
|
||||
$restoreNativeCommandPreference = $true
|
||||
}
|
||||
try {
|
||||
& $Command @Arguments *> $LogPath
|
||||
$exitCode = $LASTEXITCODE
|
||||
@@ -190,6 +201,11 @@ function Invoke-QuietStep {
|
||||
$_ | Out-File -LiteralPath $LogPath -Append -Encoding utf8
|
||||
$exitCode = 1
|
||||
}
|
||||
finally {
|
||||
if ($restoreNativeCommandPreference) {
|
||||
$PSNativeCommandUseErrorActionPreference = $previousNativeCommandPreference
|
||||
}
|
||||
}
|
||||
|
||||
$elapsed = [int]((Get-Date) - $started).TotalMilliseconds
|
||||
$summary = Measure-Log -Path $LogPath -IgnorePatterns $IgnorePatterns
|
||||
@@ -212,6 +228,9 @@ $resolvedCMake = Resolve-CMakeCommand -Requested $CMakeCommand
|
||||
$resolvedCTest = Resolve-CTestCommand -Requested $CTestCommand -ResolvedCMake $resolvedCMake
|
||||
$BuildTargets = @(Expand-ArgumentList -Values $BuildTargets)
|
||||
$IgnorePattern = @(Expand-ArgumentList -Values $IgnorePattern)
|
||||
$PlatformBuildPresets = @(Expand-ArgumentList -Values $PlatformBuildPresets)
|
||||
$PlatformBuildTargets = @(Expand-ArgumentList -Values $PlatformBuildTargets)
|
||||
$AppleRemotePresets = @(Expand-ArgumentList -Values $AppleRemotePresets)
|
||||
$ignorePatterns = Read-IgnorePatterns -FilterFile $IgnoreFilterFile -InlinePatterns $IgnorePattern
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $LogDir | Out-Null
|
||||
@@ -283,6 +302,76 @@ if (-not $SkipTests) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($IncludePlatformBuild) {
|
||||
$safePresets = if ($PlatformBuildPresets.Count -gt 0) {
|
||||
Limit-LogSlug -Value (($PlatformBuildPresets -join "_") -replace "[^A-Za-z0-9_.-]", "_")
|
||||
} else {
|
||||
"defaults"
|
||||
}
|
||||
$log = Join-Path -Path $LogDir -ChildPath "$runId-platform-build-$safePresets.log"
|
||||
$platformArgs = @(
|
||||
"-ExecutionPolicy", "Bypass",
|
||||
"-File", (Join-Path -Path $PSScriptRoot -ChildPath "platform-build.ps1"),
|
||||
"-Quiet",
|
||||
"-FailureTailLines", [string]$FailureTailLines
|
||||
)
|
||||
foreach ($preset in $PlatformBuildPresets) {
|
||||
$platformArgs += @("-Presets", $preset)
|
||||
}
|
||||
foreach ($target in $PlatformBuildTargets) {
|
||||
$platformArgs += @("-Targets", $target)
|
||||
}
|
||||
$result = Invoke-QuietStep `
|
||||
-Name "platform-build" `
|
||||
-Command "powershell" `
|
||||
-Arguments $platformArgs `
|
||||
-LogPath $log `
|
||||
-IgnorePatterns $ignorePatterns `
|
||||
-FailureTailLines $FailureTailLines
|
||||
if ($PlatformBuildPresets.Count -gt 0) {
|
||||
$result.presets = $PlatformBuildPresets
|
||||
}
|
||||
if ($PlatformBuildTargets.Count -gt 0) {
|
||||
$result.targets = $PlatformBuildTargets
|
||||
}
|
||||
$results += $result
|
||||
if ($result.exitCode -ne 0 -and $overallExitCode -eq 0) {
|
||||
$overallExitCode = $result.exitCode
|
||||
}
|
||||
}
|
||||
|
||||
if ($IncludeAppleRemote) {
|
||||
$safePresets = if ($AppleRemotePresets.Count -gt 0) {
|
||||
Limit-LogSlug -Value (($AppleRemotePresets -join "_") -replace "[^A-Za-z0-9_.-]", "_")
|
||||
} else {
|
||||
"defaults"
|
||||
}
|
||||
$log = Join-Path -Path $LogDir -ChildPath "$runId-apple-remote-$safePresets.log"
|
||||
$appleArgs = @(
|
||||
"-ExecutionPolicy", "Bypass",
|
||||
"-File", (Join-Path -Path $PSScriptRoot -ChildPath "apple-remote-build.ps1"),
|
||||
"-Quiet",
|
||||
"-FailureTailLines", [string]$FailureTailLines
|
||||
)
|
||||
foreach ($preset in $AppleRemotePresets) {
|
||||
$appleArgs += @("-Presets", $preset)
|
||||
}
|
||||
$result = Invoke-QuietStep `
|
||||
-Name "apple-remote-build" `
|
||||
-Command "powershell" `
|
||||
-Arguments $appleArgs `
|
||||
-LogPath $log `
|
||||
-IgnorePatterns $ignorePatterns `
|
||||
-FailureTailLines $FailureTailLines
|
||||
if ($AppleRemotePresets.Count -gt 0) {
|
||||
$result.presets = $AppleRemotePresets
|
||||
}
|
||||
$results += $result
|
||||
if ($result.exitCode -ne 0 -and $overallExitCode -eq 0) {
|
||||
$overallExitCode = $result.exitCode
|
||||
}
|
||||
}
|
||||
|
||||
$elapsed = [int]((Get-Date) - $started).TotalMilliseconds
|
||||
$summaryPath = Join-Path -Path $LogDir -ChildPath "$runId-summary.json"
|
||||
$payload = [ordered]@{
|
||||
|
||||
Reference in New Issue
Block a user