hypertwist/scripts/Invoke-HyperTwistDesktopPackage.ps1
2026-07-23 08:42:30 +00:00

130 lines
4.2 KiB
PowerShell

param(
[string]$ProjectRoot = 'C:\HyperTwist',
[string]$ArchiveDirectory = 'C:\HyperTwist\packaged\desktop',
[ValidateSet('Development', 'Shipping')]
[string]$Configuration = 'Development',
[string]$CookMap = '/Game/HyperTwistTraining/Maps/L_HyperTwist_ClassicTraining',
[string[]]$AdditionalCookMaps = @(
'/Game/HyperTwistTraining/Maps/L_HyperTwist_FollowAlongTraining',
'/Game/HyperTwistTraining/Maps/L_HyperTwist_Magic120CellTraining',
'/Game/HyperTwistTraining/Maps/L_HyperTwist_MagicCube5DTraining'
),
[string[]]$SmokeMaps = @(
'/Game/HyperTwistTraining/Maps/L_HyperTwist_ClassicTraining',
'/Game/HyperTwistTraining/Maps/L_HyperTwist_FollowAlongTraining',
'/Game/HyperTwistTraining/Maps/L_HyperTwist_Magic120CellTraining',
'/Game/HyperTwistTraining/Maps/L_HyperTwist_MagicCube5DTraining'
),
[string[]]$AdditionalCookerOptions = @(
'-DisablePlugins=MovieRenderPipeline',
'-SkipCookingEditorContent'
),
[bool]$HeadlessSmoke = $true,
[string]$ValidationReportPath = '',
[string]$LaunchSurfaceReportPath = '',
[string]$SolverTablePath = '',
[Int64]$ExpectedSolverTableSizeBytes = 676207080,
[string]$ExpectedSolverTableSha256 = 'dc6de3d909a37afe2ba7f1f978543a13eae215bd20d954d66813524a8ca20034',
[string]$ZipOutputPath = '',
[string]$ZipExportReportPath = '',
[switch]$CleanArchive,
[switch]$SkipBuild,
[switch]$SkipLaunch,
[switch]$CreateZip
)
$ErrorActionPreference = 'Stop'
$ClassicPackageScriptPath = Join-Path $PSScriptRoot 'Invoke-HyperTwistClassicCubePackage.ps1'
$DesktopLaunchScriptPath = Join-Path $PSScriptRoot 'Launch-HyperTwistDesktopPackage.ps1'
$ZipExportScriptPath = Join-Path $PSScriptRoot 'Export-HyperTwistPackagedBuildZip.ps1'
$ValidationDirectory = Join-Path $ArchiveDirectory 'validation'
if (-not (Test-Path -LiteralPath $ClassicPackageScriptPath))
{
throw "Classic-cube package helper was not found at '$ClassicPackageScriptPath'."
}
if (-not (Test-Path -LiteralPath $DesktopLaunchScriptPath))
{
throw "Desktop launch helper was not found at '$DesktopLaunchScriptPath'."
}
if (-not (Test-Path -LiteralPath $ZipExportScriptPath))
{
throw "Packaged-zip export helper was not found at '$ZipExportScriptPath'."
}
if ([string]::IsNullOrWhiteSpace($ValidationReportPath))
{
$ValidationReportPath = Join-Path $ValidationDirectory 'desktop-package-validation-report.json'
}
if ([string]::IsNullOrWhiteSpace($LaunchSurfaceReportPath))
{
$LaunchSurfaceReportPath = Join-Path $ValidationDirectory 'desktop-launch-surface-report.json'
}
if ([string]::IsNullOrWhiteSpace($ZipExportReportPath))
{
$ZipExportReportPath = Join-Path $ValidationDirectory 'desktop-zip-export-report.json'
}
$InvokeParameters = @{
ProjectRoot = $ProjectRoot
ArchiveDirectory = $ArchiveDirectory
Configuration = $Configuration
CookMap = $CookMap
AdditionalCookMaps = $AdditionalCookMaps
SmokeMaps = $SmokeMaps
AdditionalCookerOptions = $AdditionalCookerOptions
HeadlessSmoke = $HeadlessSmoke
ValidationReportPath = $ValidationReportPath
SolverTablePath = $SolverTablePath
ExpectedSolverTableSizeBytes = $ExpectedSolverTableSizeBytes
ExpectedSolverTableSha256 = $ExpectedSolverTableSha256
}
if ($CleanArchive)
{
$InvokeParameters.CleanArchive = $true
}
if ($SkipBuild)
{
$InvokeParameters.SkipBuild = $true
}
if ($SkipLaunch)
{
$InvokeParameters.SkipLaunch = $true
}
& $ClassicPackageScriptPath @InvokeParameters
if (-not $SkipLaunch)
{
$DesktopLaunchParameters = @{
PackageRoot = $ArchiveDirectory
ReportPath = $LaunchSurfaceReportPath
UseNullRHI = $HeadlessSmoke
NoSound = $HeadlessSmoke
RequireStartupDiagnostics = $true
}
if (-not $HeadlessSmoke)
{
$DesktopLaunchParameters.ExpectedStartupDiagnosticsResult = 'launch-menu-renderable'
}
& $DesktopLaunchScriptPath @DesktopLaunchParameters
}
if ($CreateZip)
{
& $ZipExportScriptPath `
-PackageRoot $ArchiveDirectory `
-DestinationZipPath $ZipOutputPath `
-ReportPath $ZipExportReportPath `
-ExpectedSolverTableSizeBytes $ExpectedSolverTableSizeBytes `
-ExpectedSolverTableSha256 $ExpectedSolverTableSha256
}