#requires -Version 7.0
param([string]$Package)
$ErrorActionPreference = 'Stop'
$taskRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
$taskRun = Join-Path $taskRoot ('artifacts/ability-editor-' + [Guid]::NewGuid().ToString('N'))
New-Item -ItemType Directory -Path $taskRun -Force | Out-Null
foreach ($taskRole in @('Player', 'Admin')) {
$taskFolder = if ($taskRole -eq 'Player') { 'Client' } else { 'Admin' }
if ($Package) {
$taskExe = Join-Path ([IO.Path]::GetFullPath($Package)) "$taskFolder/XFEWarframe.$taskRole.exe"
} else {
$taskProject = Join-Path $taskRoot "$taskFolder/XFEWarframe.$taskRole/XFEWarframe.$taskRole.csproj"
$taskOutput = Join-Path $taskRun $taskFolder
dotnet build $taskProject -c Release -p:Platform=x64 ("-p:XFEIntermediateRoot=" + (Join-Path $taskRun 'obj')) ("-p:OutputPath=$taskOutput/") --nologo -v quiet
if ($LASTEXITCODE -ne 0) { throw "$taskRole build failed" }
$taskExe = Join-Path $taskOutput "XFEWarframe.$taskRole.exe"
}
$taskReport = Join-Path $taskRun "$taskRole.json"
$taskProfile = Join-Path $taskRun "$taskRole-Profile"
# This invokes only our hidden, in-process native control fixture. It never
# activates a window, sends desktop input, starts a server or accesses the game.
$taskProcess = Start-Process -FilePath $taskExe -WorkingDirectory (Split-Path $taskExe) -WindowStyle Hidden -PassThru -ArgumentList @(
"`"--verify-ui=$taskReport`"", "`"--profile-root=$taskProfile`"", '--verify-ability-controls=true', '--ui-language=zh')
try {
if (-not $taskProcess.WaitForExit(45000)) { throw "$taskRole hidden control verification timed out" }
if (-not (Test-Path -LiteralPath $taskReport)) { throw "$taskRole did not write a report (exit $($taskProcess.ExitCode)). See $taskProfile/Logs/desktop.log" }
$taskResult = Get-Content -LiteralPath $taskReport -Raw | ConvertFrom-Json
if (-not $taskResult.passed -or $taskProcess.ExitCode -ne 0) { throw "$taskRole verification failed: $($taskResult.error)" }
Write-Output "PASS $taskRole : $($taskResult.checks.Count) native control checks"
} finally {
if (-not $taskProcess.HasExited) { Stop-Process -Id $taskProcess.Id }
$taskProcess.Dispose()
}
}
Write-Output "Reports: $taskRun"
#requires -Version 7.0
param([string]$Package)
$ErrorActionPreference = 'Stop'
$taskRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
$taskRun = Join-Path $taskRoot ('artifacts/ability-editor-' + [Guid]::NewGuid().ToString('N'))
New-Item -ItemType Directory -Path $taskRun -Force | Out-Null
foreach ($taskRole in @('Player', 'Admin')) {
$taskFolder = if ($taskRole -eq 'Player') { 'Client' } else { 'Admin' }
if ($Package) {
$taskExe = Join-Path ([IO.Path]::GetFullPath($Package)) "$taskFolder/XFEWarframe.$taskRole.exe"
} else {
$taskProject = Join-Path $taskRoot "$taskFolder/XFEWarframe.$taskRole/XFEWarframe.$taskRole.csproj"
$taskOutput = Join-Path $taskRun $taskFolder
dotnet build $taskProject -c Release -p:Platform=x64 ("-p:XFEIntermediateRoot=" + (Join-Path $taskRun 'obj')) ("-p:OutputPath=$taskOutput/") --nologo -v quiet
if ($LASTEXITCODE -ne 0) { throw "$taskRole build failed" }
$taskExe = Join-Path $taskOutput "XFEWarframe.$taskRole.exe"
}
$taskReport = Join-Path $taskRun "$taskRole.json"
$taskProfile = Join-Path $taskRun "$taskRole-Profile"
# This invokes only our hidden, in-process native control fixture. It never
# activates a window, sends desktop input, starts a server or accesses the game.
$taskProcess = Start-Process -FilePath $taskExe -WorkingDirectory (Split-Path $taskExe) -WindowStyle Hidden -PassThru -ArgumentList @(
"`"--verify-ui=$taskReport`"", "`"--profile-root=$taskProfile`"", '--verify-ability-controls=true', '--ui-language=zh')
try {
if (-not $taskProcess.WaitForExit(45000)) { throw "$taskRole hidden control verification timed out" }
if (-not (Test-Path -LiteralPath $taskReport)) { throw "$taskRole did not write a report (exit $($taskProcess.ExitCode)). See $taskProfile/Logs/desktop.log" }
$taskResult = Get-Content -LiteralPath $taskReport -Raw | ConvertFrom-Json
if (-not $taskResult.passed -or $taskProcess.ExitCode -ne 0) { throw "$taskRole verification failed: $($taskResult.error)" }
Write-Output "PASS $taskRole : $($taskResult.checks.Count) native control checks"
} finally {
if (-not $taskProcess.HasExited) { Stop-Process -Id $taskProcess.Id }
$taskProcess.Dispose()
}
}
Write-Output "Reports: $taskRun"