Build cross-runtime CultUI parity smoke

This commit is contained in:
Meta Vens 2026-06-05 22:07:43 +01:00
commit c12d78726a
29 changed files with 1435 additions and 156 deletions

View file

@ -94,6 +94,9 @@ if ($kotlinSources.Count -gt 0) {
}
Invoke-Checked $jar @("cf", $classesJar, "-C", $classes, ".")
Invoke-Checked $d8 @("--lib", $androidJar, "--output", $dex, $classesJar, $cultMeshJar, $kotlinStdlib)
if (Test-Path (Join-Path $androidRoot "src\main\assets")) {
Invoke-Checked $jar @("uf", $unsigned, "-C", (Join-Path $androidRoot "src\main"), "assets")
}
Invoke-Checked $jar @("uf", $unsigned, "-C", $dex, "classes.dex")
Invoke-Checked $zipalign @("-f", "4", $unsigned, $aligned)

View file

@ -8,6 +8,7 @@ param(
[int] $Height = 0,
[ValidateSet("portrait", "landscape", "natural")]
[string] $Orientation = "natural",
[switch] $UseFixture,
[switch] $ForceInstall
)
@ -61,7 +62,11 @@ try {
}
}
adb shell am start -n "$PackageName/$ActivityName" | Out-Host
$launchArgs = @("shell", "am", "start", "-n", "$PackageName/$ActivityName")
if ($UseFixture) {
$launchArgs += @("--ez", "org.gamecult.eve.PARITY_FIXTURE", "true")
}
adb @launchArgs | Out-Host
if ($LASTEXITCODE -ne 0) {
throw "adb launch failed with exit code $LASTEXITCODE"
}

View file

@ -1,7 +1,8 @@
param(
[string] $Target = "eve",
[string] $OutputDirectory = "artifacts\screenshots",
[string] $BundleId = "org.gamecult.evecanvas"
[string] $BundleId = "org.gamecult.evecanvas",
[string] $FixturePath = ""
)
$ErrorActionPreference = "Stop"
@ -19,10 +20,17 @@ $localPath = Join-Path $outputRoot "eve-$stamp.png"
$remoteDir = "/var/mobile/Library/EveCanvas"
$remotePath = "$remoteDir/latest-screenshot.png"
$requestPath = "$remoteDir/capture-request"
$remoteFixturePath = "$remoteDir/current-surface.json"
ssh $Target "uiopen --bundleid '$BundleId' >/dev/null 2>&1 || true"
Start-Sleep -Seconds 1
ssh $Target "mkdir -p '$remoteDir' && chown mobile:mobile '$remoteDir' && rm -f '$remotePath' '$requestPath' && touch '$requestPath' && chown mobile:mobile '$requestPath' 2>/dev/null || true"
ssh $Target "mkdir -p '$remoteDir' && chown mobile:mobile '$remoteDir' && rm -f '$remotePath' '$requestPath' && chown mobile:mobile '$remoteDir' 2>/dev/null || true"
if ($FixturePath) {
scp $FixturePath "${Target}:$remoteFixturePath" | Out-Host
} else {
ssh $Target "rm -f '$remoteFixturePath'"
}
ssh $Target "touch '$requestPath' && chown mobile:mobile '$requestPath' 2>/dev/null || true"
$deadline = (Get-Date).AddSeconds(10)
do {

View file

@ -3,6 +3,7 @@ param(
[string] $Target = "windows",
[ValidateSet("phone", "tablet", "desktop")]
[string] $ViewportId = "desktop",
[string] $FixtureId = "cultui-inspector",
[string] $OutputPath = "artifacts\parity\flutter-windows-cultui-inspector.png"
)
@ -11,8 +12,12 @@ $ErrorActionPreference = "Stop"
$projectRoot = Split-Path -Parent $PSScriptRoot
$flutterRoot = Join-Path $projectRoot "flutter\eve_parity"
$flutter = Join-Path $projectRoot "tools\deps\flutter\bin\flutter.bat"
$assetPath = Join-Path $flutterRoot "assets\current-surface.json"
$fontDir = Join-Path $flutterRoot "assets\fonts"
$absoluteOutput = if ([System.IO.Path]::IsPathRooted($OutputPath)) { $OutputPath } else { Join-Path $projectRoot $OutputPath }
New-Item -ItemType Directory -Force (Split-Path -Parent $absoluteOutput) | Out-Null
New-Item -ItemType Directory -Force (Split-Path -Parent $assetPath) | Out-Null
New-Item -ItemType Directory -Force $fontDir | Out-Null
if (-not (Test-Path $flutter)) {
throw "Flutter is not installed at $flutter"
@ -22,9 +27,17 @@ if ($Target -eq "linux" -and $env:OS -like "Windows*") {
throw "Linux Flutter screenshot requires a Linux runner; this host is Windows."
}
Copy-Item -LiteralPath (Join-Path $projectRoot "tools\deps\flutter\bin\cache\artifacts\material_fonts\roboto-regular.ttf") -Destination (Join-Path $fontDir "Roboto-Regular.ttf") -Force
Copy-Item -LiteralPath (Join-Path $projectRoot "tools\deps\flutter\bin\cache\artifacts\material_fonts\roboto-bold.ttf") -Destination (Join-Path $fontDir "Roboto-Bold.ttf") -Force
node .\tools\parity\export-fixture.mjs $FixtureId $assetPath | Out-Host
if ($LASTEXITCODE -ne 0) {
throw "Fixture export failed with exit code $LASTEXITCODE"
}
Push-Location $flutterRoot
try {
& $flutter test --update-goldens
& $flutter test --update-goldens "--dart-define=EVE_PARITY_FIXTURE=$FixtureId" --plain-name $ViewportId
if ($LASTEXITCODE -ne 0) {
throw "Flutter golden smoke failed with exit code $LASTEXITCODE"
}
@ -32,7 +45,7 @@ try {
Pop-Location
}
$golden = Join-Path $flutterRoot "test\goldens\cultui-inspector-$ViewportId.png"
$golden = Join-Path $flutterRoot "test\goldens\$FixtureId-$ViewportId.png"
if (-not (Test-Path $golden) -or (Get-Item $golden).Length -le 0) {
throw "Flutter golden did not produce a PNG: $golden"
}

View file

@ -2,6 +2,7 @@ param(
[string] $SshTarget = "nightwing",
[ValidateSet("phone", "tablet", "desktop")]
[string] $ViewportId = "desktop",
[string] $FixtureId = "cultui-inspector",
[string] $OutputPath = "artifacts\parity\linux-flutter-cultui-inspector.png",
[string] $RemoteRoot = "~/.local/share/gamecult/eve-parity-runner",
[string] $RemoteFlutter = "~/.local/share/gamecult/flutter/bin/flutter"
@ -11,14 +12,25 @@ $ErrorActionPreference = "Stop"
$projectRoot = Split-Path -Parent $PSScriptRoot
$sourceRoot = Join-Path $projectRoot "flutter\eve_parity"
$assetPath = Join-Path $sourceRoot "assets\current-surface.json"
$fontDir = Join-Path $sourceRoot "assets\fonts"
$absoluteOutput = if ([System.IO.Path]::IsPathRooted($OutputPath)) { $OutputPath } else { Join-Path $projectRoot $OutputPath }
$archivePath = Join-Path ([System.IO.Path]::GetTempPath()) "eve-parity-linux-$([guid]::NewGuid()).tar"
New-Item -ItemType Directory -Force (Split-Path -Parent $absoluteOutput) | Out-Null
New-Item -ItemType Directory -Force (Split-Path -Parent $assetPath) | Out-Null
New-Item -ItemType Directory -Force $fontDir | Out-Null
if (-not (Test-Path $sourceRoot)) {
throw "Flutter parity source not found: $sourceRoot"
}
node .\tools\parity\export-fixture.mjs $FixtureId $assetPath | Out-Host
if ($LASTEXITCODE -ne 0) {
throw "Fixture export failed with exit code $LASTEXITCODE"
}
Copy-Item -LiteralPath (Join-Path $projectRoot "tools\deps\flutter\bin\cache\artifacts\material_fonts\roboto-regular.ttf") -Destination (Join-Path $fontDir "Roboto-Regular.ttf") -Force
Copy-Item -LiteralPath (Join-Path $projectRoot "tools\deps\flutter\bin\cache\artifacts\material_fonts\roboto-bold.ttf") -Destination (Join-Path $fontDir "Roboto-Bold.ttf") -Force
try {
Push-Location $sourceRoot
try {
@ -33,12 +45,12 @@ try {
ssh $SshTarget "rm -rf $RemoteRoot && mkdir -p $RemoteRoot"
scp $archivePath "${SshTarget}:/tmp/eve-parity-linux.tar" | Out-Host
ssh $SshTarget "tar -xf /tmp/eve-parity-linux.tar -C $RemoteRoot && rm /tmp/eve-parity-linux.tar"
ssh $SshTarget "cd $RemoteRoot && $RemoteFlutter test --update-goldens" | Out-Host
ssh $SshTarget "cd $RemoteRoot && $RemoteFlutter test --update-goldens --dart-define=EVE_PARITY_FIXTURE=$FixtureId --plain-name $ViewportId" | Out-Host
if ($LASTEXITCODE -ne 0) {
throw "Nightwing Flutter golden smoke failed with exit code $LASTEXITCODE"
}
$remoteGolden = "$RemoteRoot/test/goldens/cultui-inspector-$ViewportId.png"
$remoteGolden = "$RemoteRoot/test/goldens/$FixtureId-$ViewportId.png"
scp "${SshTarget}:$remoteGolden" $absoluteOutput | Out-Host
if ($LASTEXITCODE -ne 0) {
throw "scp from Nightwing failed with exit code $LASTEXITCODE"

View file

@ -74,9 +74,19 @@ try {
}
Invoke-Capture "ios" {
$iosFixture = Join-Path $runRoot "ios-current-surface.json"
node .\tools\parity\export-fixture.mjs $ProviderId $iosFixture | Out-Host
powershell -ExecutionPolicy Bypass -File .\scripts\capture-eve-screenshot.ps1 `
-Target $IosSshTarget `
-OutputDirectory $runRoot
-OutputDirectory $runRoot `
-FixturePath $iosFixture
}
New-Item -ItemType Directory -Force .\android\app\src\main\assets | Out-Null
node .\tools\parity\export-fixture.mjs $ProviderId .\android\app\src\main\assets\current-surface.json | Out-Host
powershell -ExecutionPolicy Bypass -File .\scripts\build-android.ps1 | Out-Host
if ($LASTEXITCODE -ne 0) {
throw "Android fixture APK build failed with exit code $LASTEXITCODE"
}
foreach ($case in $responsiveCases) {
@ -85,7 +95,9 @@ try {
-OutputPath (Join-Path $runRoot "android-periwinkle-$($case.id).png") `
-Width $case.width `
-Height $case.height `
-Orientation $case.orientation
-Orientation $case.orientation `
-UseFixture `
-ForceInstall
}
}
@ -93,7 +105,8 @@ try {
Invoke-Capture "android-$($case.id)" {
powershell -ExecutionPolicy Bypass -File .\scripts\capture-android-screenshot.ps1 `
-OutputPath (Join-Path $runRoot "android-periwinkle-$($case.id).png") `
-Orientation $case.orientation
-Orientation $case.orientation `
-UseFixture
}
}
@ -101,8 +114,9 @@ try {
Invoke-Capture "windows-$($case.id)" {
powershell -ExecutionPolicy Bypass -File .\scripts\capture-flutter-parity.ps1 `
-Target windows `
-FixtureId $ProviderId `
-ViewportId $case.id `
-OutputPath (Join-Path $runRoot "windows-flutter-cultui-inspector-$($case.id).png")
-OutputPath (Join-Path $runRoot "windows-flutter-$ProviderId-$($case.id).png")
}
}
@ -110,8 +124,9 @@ try {
Invoke-Capture "linux-$($case.id)" {
powershell -ExecutionPolicy Bypass -File .\scripts\capture-linux-flutter-parity.ps1 `
-SshTarget $LinuxSshTarget `
-FixtureId $ProviderId `
-ViewportId $case.id `
-OutputPath (Join-Path $runRoot "linux-flutter-cultui-inspector-$($case.id).png")
-OutputPath (Join-Path $runRoot "linux-flutter-$ProviderId-$($case.id).png")
}
}

View file

@ -15,6 +15,13 @@ if (Test-Path $archive) {
tar `
--exclude=.git `
--exclude=.theos `
--exclude=android `
--exclude=artifacts `
--exclude=docs `
--exclude=flutter `
--exclude=tools `
--exclude=web `
--exclude=.voidbot `
--exclude=packages `
-cf $archive `
-C $projectRoot .