XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEEDToolBox

【WinUI】XFE精英危险工具箱

公开
关注 0 Fork 0 Star 0
UTF-8
param(
    [Parameter(Mandatory=$true)][ValidatePattern('^(interface|original-data)-[0-9]+$')][string]$Cut,
    [switch]$Streaming
)
$ErrorActionPreference='Stop'
$taskRoot=(Resolve-Path (Join-Path $PSScriptRoot '..')).Path
$output=Join-Path $taskRoot "work/visual/galaxy-full/$Cut"
if(Test-Path -LiteralPath $output){throw "Refusing to replace an existing evidence cut: $output"}
$null=New-Item -ItemType Directory -Path $output
$binaryDirectory=Join-Path $taskRoot 'XFEEDToolBox/bin/x64/Release/net10.0-windows10.0.22621.0/win-x64'
$exe=Join-Path $binaryDirectory 'XFEEDToolBox.exe'
$files=@('XFEEDToolBox.exe','XFEEDToolBox.dll','XFEEDToolBox.Core.dll','Assets/GalaxyMap.hlsl','Assets/GalaxyTrade.hlsl','Assets/GalaxyCore.hlsl','Assets/GalaxyHdr.hlsl','Assets/GalaxyPlane.hlsl','Assets/GalaxyBlackHole.hlsl','Assets/GalaxyPowerActivityRing.hlsl','Assets/GalaxyPowerActivityBillboard.hlsl','Assets/GalaxyManualExposure.dxbc')
$binaries=@($files | ForEach-Object {Get-FileHash -LiteralPath (Join-Path $binaryDirectory $_) -Algorithm SHA256 | Select-Object Path,Hash})
$arguments=@('--smoke-interface',(Join-Path $output 'result.json'),'--probe-galaxy-nebula','--probe-galaxy-rework',
    '--offline-preview','--data-dir',(Join-Path $output 'data'),'--galaxy-fixture',(Join-Path $taskRoot 'work/visual/galaxy-rework/local-recorded-fixture.json'),
    '--core-fixture',(Join-Path $taskRoot 'artifacts/nebula-0416/native-core-700.json'))
if($Streaming){$arguments+='--probe-galaxy-streaming'}
# Start-Process joins arguments into a command line. Paths are literal values,
# individually quoted, and never passed to another shell for interpretation.
$quotedArguments=@($arguments | ForEach-Object {'"'+$_+'"'})
$process=Start-Process -FilePath $exe -ArgumentList $quotedArguments -WorkingDirectory $binaryDirectory -WindowStyle Hidden -PassThru
@{binaries=$binaries;capturedAt=[DateTime]::UtcNow.ToString('O');processId=$process.Id;cut=$Cut;streaming=[bool]$Streaming} |
    ConvertTo-Json -Depth 5 | Set-Content -LiteralPath (Join-Path $output 'build-metadata.json') -Encoding utf8
@{cut=$Cut;processId=$process.Id;result=(Join-Path $output 'result.json')} | ConvertTo-Json -Compress