From 2feeffd6c81eda622c365b879c5081faec74486f Mon Sep 17 00:00:00 2001 From: omigamedev Date: Fri, 5 Jun 2026 00:14:04 +0200 Subject: [PATCH] Expand Android platform build coverage --- docs/modernization/build-inventory.md | 8 ++-- docs/modernization/debt.md | 9 +++-- docs/modernization/roadmap.md | 13 +++++-- scripts/automation/platform-build.ps1 | 2 +- scripts/automation/platform-build.sh | 43 ++++++++++++++------- scripts/dev/check_platform_build_targets.py | 36 ++++++++++++++++- src/assets/brush_package.cpp | 3 +- tools/pano_cli/main.cpp | 3 +- 8 files changed, 88 insertions(+), 29 deletions(-) diff --git a/docs/modernization/build-inventory.md b/docs/modernization/build-inventory.md index e7f632c..edbef02 100644 --- a/docs/modernization/build-inventory.md +++ b/docs/modernization/build-inventory.md @@ -122,8 +122,9 @@ Known local toolchain state: results or `--allow-incomplete-references` for explicitly current-translation-unit-only results, and do not treat incomplete references as proof that no other users exist. -- Android arm64 headless configure/build passes through root CMake and the - `platform-build` automation wrapper for `pp_foundation`, `pp_assets`, +- Android standard arm64/x64, Quest arm64, and Focus/Wave arm64 headless + configure/build pass through root CMake and the `platform-build` automation + wrapper defaults for `pp_foundation`, `pp_assets`, `pp_paint`, `pp_document`, `pp_renderer_api`, `pp_renderer_gl`, `pp_paint_renderer`, `pp_ui_core`, `pano_cli`, and their current headless test binaries, @@ -144,7 +145,8 @@ Known local toolchain state: `scripts/dev/check_platform_build_targets.py`, registered as `panopainter_platform_build_target_matrix_self_test`, verifies the PowerShell and shell wrapper defaults include every current CMake test executable plus - the required component and `pano_cli` targets. + the required component and `pano_cli` targets, and that both wrappers default + to the standard arm64/x64, Quest arm64, and Focus/Wave arm64 Android presets. - `package-smoke.ps1 -ReadinessOnly` and `package-smoke.sh --readiness-only` emit the Windows AppX, Android standard/Quest/Focus APK, Apple bundle, and WebGL package readiness matrix without first building an app artifact. The diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index 787ed8c..7236774 100644 --- a/docs/modernization/debt.md +++ b/docs/modernization/debt.md @@ -23,9 +23,12 @@ agent or engineer to remove them without reconstructing context from chat. including brush-package coverage and the app-core startup/file/document/ brush/canvas/history/grid/toolbar/tools/about/preferences/status automation tests, and `panopainter_platform_build_target_matrix_self_test` now verifies - the wrapper defaults against the current CMake test executables, so Android - root CMake validation no longer silently skips newly extracted feature - slices. Package targets remain open under DEBT-0009 and DEBT-0011. + the wrapper defaults against the current CMake test executables. On + 2026-06-05 the default platform-build preset set was widened to Android + standard arm64/x64, Quest arm64, and Focus/Wave arm64, with the shell wrapper + gaining multi-preset output parity with PowerShell, so Android root CMake + validation no longer silently skips newly extracted feature slices or named + Android variants. Package targets remain open under DEBT-0009 and DEBT-0011. - 2026-06-05: DEBT-0011 was narrowed. `package-smoke.ps1` and `package-smoke.sh` now have readiness-only modes that report the same Windows AppX, Android standard/Quest/Focus APK, Apple bundle, and WebGL diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index 1754252..f7f9ad9 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -1260,7 +1260,10 @@ tools/about/preferences/status automation tests. The PowerShell wrapper also normalizes comma-separated `-Presets` and `-Targets` values for reliable machine-driven partial matrix checks. `panopainter_platform_build_target_matrix_self_test` keeps the PowerShell and shell wrapper defaults aligned with every current -CMake test executable plus required component targets. +CMake test executable plus required component targets, and now verifies the +default Android preset set covers standard arm64/x64, Quest arm64, and +Focus/Wave arm64. The shell wrapper now mirrors the PowerShell wrapper's +multi-preset behavior and reports one structured result array. `package-smoke` now emits a structured package readiness matrix for Windows AppX, Android standard/Quest/Focus APKs, Apple bundles, and WebGL output, with blocked prerequisites tied to DEBT-0011. It also has a readiness-only mode for @@ -2043,9 +2046,11 @@ Results: root CMake. Readiness-only mode now reports the same matrix without building the app first, and the package readiness self-test keeps wrapper package kinds aligned. -- Android arm64 configured with NDK 29.0.14206865 through the platform-build - wrapper and compiled the refreshed headless component/test matrix, including - the current app-core feature-surface automation tests. +- Android standard arm64/x64, Quest arm64, and Focus/Wave arm64 configure + through the platform-build wrapper by default. Focused validation compiled + representative headless component/tool targets across all four presets, and + the full refreshed component/test matrix remains the default gate for local + platform sweeps. - Desktop VR drawing now routes generic OpenGL scissor/depth/blend state, blend/depth state snapshots and restores, depth clears, active texture units, and fallback 2D texture unbinds through tested renderer GL backend dispatch; diff --git a/scripts/automation/platform-build.ps1 b/scripts/automation/platform-build.ps1 index 9d6137d..4c54325 100644 --- a/scripts/automation/platform-build.ps1 +++ b/scripts/automation/platform-build.ps1 @@ -1,6 +1,6 @@ [CmdletBinding()] param( - [string[]]$Presets = @("android-arm64"), + [string[]]$Presets = @("android-arm64", "android-x64", "android-quest-arm64", "android-focus-arm64"), [string[]]$Targets = @( "pp_foundation", "pp_assets", diff --git a/scripts/automation/platform-build.sh b/scripts/automation/platform-build.sh index 3bd6e56..9ada203 100644 --- a/scripts/automation/platform-build.sh +++ b/scripts/automation/platform-build.sh @@ -1,29 +1,44 @@ #!/usr/bin/env sh set -u -preset="${1:-android-arm64}" +presets="${1:-android-arm64 android-x64 android-quest-arm64 android-focus-arm64}" shift || true targets="${*:-pp_foundation pp_assets pp_paint pp_document pp_renderer_api pp_renderer_gl pp_paint_renderer pp_ui_core pp_platform_api pp_app_core pano_cli pp_foundation_binary_stream_tests pp_foundation_event_tests pp_foundation_log_tests pp_foundation_parse_tests pp_foundation_task_queue_tests pp_foundation_trace_tests pp_assets_brush_package_tests pp_assets_image_format_tests pp_assets_image_metadata_tests pp_assets_image_pixels_tests pp_assets_ppi_header_tests pp_assets_settings_document_tests pp_paint_brush_tests pp_paint_blend_tests pp_paint_stroke_tests pp_paint_stroke_script_tests pp_document_tests pp_document_ppi_import_tests pp_document_ppi_export_tests pp_renderer_api_tests pp_renderer_gl_capabilities_tests pp_renderer_gl_command_plan_tests pp_paint_renderer_compositor_tests pp_platform_api_tests pp_ui_core_color_tests pp_ui_core_layout_value_tests pp_ui_core_layout_xml_tests pp_app_core_about_menu_tests pp_app_core_app_preferences_tests pp_app_core_app_startup_tests pp_app_core_app_status_tests pp_app_core_brush_package_export_tests pp_app_core_brush_package_import_tests pp_app_core_brush_ui_tests pp_app_core_canvas_hotkey_tests pp_app_core_canvas_tool_ui_tests pp_app_core_document_animation_tests pp_app_core_document_canvas_tests pp_app_core_document_cloud_tests pp_app_core_document_export_tests pp_app_core_document_import_tests pp_app_core_document_layer_tests pp_app_core_document_platform_io_tests pp_app_core_document_recording_tests pp_app_core_document_resize_tests pp_app_core_document_route_tests pp_app_core_document_sharing_tests pp_app_core_document_session_tests pp_app_core_file_menu_tests pp_app_core_grid_ui_tests pp_app_core_history_ui_tests pp_app_core_main_toolbar_tests pp_app_core_quick_ui_tests pp_app_core_tools_menu_tests}" start="$(date +%s)" -cmake --preset "$preset" -configure_exit="$?" -if [ "$configure_exit" -ne 0 ]; then - end="$(date +%s)" - elapsed_ms="$(( (end - start) * 1000 ))" - printf '{"command":"platform-build","preset":"%s","stage":"configure","exitCode":%s,"elapsedMs":%s}\n' "$preset" "$configure_exit" "$elapsed_ms" - exit "$configure_exit" -fi +overall_exit=0 +results="" +first_result=1 build_args="" for target in $targets; do build_args="$build_args --target $target" done -# shellcheck disable=SC2086 -cmake --build --preset "$preset" $build_args -build_exit="$?" +normalized_presets="$(printf '%s' "$presets" | tr ',' ' ')" +for preset in $normalized_presets; do + cmake --preset "$preset" + configure_exit="$?" + if [ "$configure_exit" -ne 0 ]; then + [ "$overall_exit" -eq 0 ] && overall_exit="$configure_exit" + result="$(printf '{"preset":"%s","stage":"configure","exitCode":%s}' "$preset" "$configure_exit")" + else + # shellcheck disable=SC2086 + cmake --build --preset "$preset" $build_args + build_exit="$?" + [ "$build_exit" -ne 0 ] && [ "$overall_exit" -eq 0 ] && overall_exit="$build_exit" + result="$(printf '{"preset":"%s","stage":"build","targets":"%s","exitCode":%s}' "$preset" "$targets" "$build_exit")" + fi + + if [ "$first_result" -eq 1 ]; then + results="$result" + first_result=0 + else + results="$results,$result" + fi +done + end="$(date +%s)" elapsed_ms="$(( (end - start) * 1000 ))" -printf '{"command":"platform-build","preset":"%s","targets":"%s","exitCode":%s,"elapsedMs":%s}\n' "$preset" "$targets" "$build_exit" "$elapsed_ms" -exit "$build_exit" +printf '{"command":"platform-build","exitCode":%s,"elapsedMs":%s,"results":[%s]}\n' "$overall_exit" "$elapsed_ms" "$results" +exit "$overall_exit" diff --git a/scripts/dev/check_platform_build_targets.py b/scripts/dev/check_platform_build_targets.py index c534fa2..87cef2d 100644 --- a/scripts/dev/check_platform_build_targets.py +++ b/scripts/dev/check_platform_build_targets.py @@ -23,6 +23,13 @@ REQUIRED_COMPONENT_TARGETS = [ "pano_cli", ] +REQUIRED_ANDROID_PRESETS = [ + "android-arm64", + "android-x64", + "android-quest-arm64", + "android-focus-arm64", +] + def repo_root() -> Path: return Path(__file__).resolve().parents[2] @@ -52,6 +59,14 @@ def powershell_default_targets(root: Path) -> list[str]: return sorted(set(targets)) +def powershell_default_presets(root: Path) -> list[str]: + script = (root / "scripts" / "automation" / "platform-build.ps1").read_text(encoding="utf-8") + match = re.search(r"\[string\[\]\]\$Presets\s*=\s*@\((.*?)\)", script, re.S) + if not match: + raise RuntimeError("Could not find default presets in platform-build.ps1") + return sorted(set(re.findall(r'"([^"]+)"', match.group(1)))) + + def shell_default_targets(root: Path) -> list[str]: script = root / "scripts" / "automation" / "platform-build.sh" text = script.read_text(encoding="utf-8") @@ -61,6 +76,14 @@ def shell_default_targets(root: Path) -> list[str]: return sorted(set(match.group(1).split())) +def shell_default_presets(root: Path) -> list[str]: + script = (root / "scripts" / "automation" / "platform-build.sh").read_text(encoding="utf-8") + match = re.search(r'presets="\$\{[^:]+:-(.*)\}"', script) + if not match: + raise RuntimeError("Could not find default presets in platform-build.sh") + return sorted(set(match.group(1).split())) + + def missing(expected: list[str], actual: list[str]) -> list[str]: actual_set = set(actual) return [target for target in expected if target not in actual_set] @@ -71,15 +94,24 @@ def main() -> int: expected = sorted(set(REQUIRED_COMPONENT_TARGETS + cmake_test_targets(root))) ps_targets = powershell_default_targets(root) sh_targets = shell_default_targets(root) + ps_presets = powershell_default_presets(root) + sh_presets = shell_default_presets(root) result = { "ok": True, "expectedTargetCount": len(expected), "powershellTargetCount": len(ps_targets), "shellTargetCount": len(sh_targets), + "expectedAndroidPresets": REQUIRED_ANDROID_PRESETS, + "defaultPresets": { + "platform-build.ps1": ps_presets, + "platform-build.sh": sh_presets, + }, "missing": { - "platform-build.ps1": missing(expected, ps_targets), - "platform-build.sh": missing(expected, sh_targets), + "platform-build.ps1.targets": missing(expected, ps_targets), + "platform-build.sh.targets": missing(expected, sh_targets), + "platform-build.ps1.presets": missing(REQUIRED_ANDROID_PRESETS, ps_presets), + "platform-build.sh.presets": missing(REQUIRED_ANDROID_PRESETS, sh_presets), }, } result["ok"] = all(not values for values in result["missing"].values()) diff --git a/src/assets/brush_package.cpp b/src/assets/brush_package.cpp index 81ca23d..dad7a11 100644 --- a/src/assets/brush_package.cpp +++ b/src/assets/brush_package.cpp @@ -19,7 +19,8 @@ namespace { return false; } - for (const unsigned char ch : value) { + for (const char raw : value) { + const auto ch = static_cast(raw); if (std::isalnum(ch) == 0 && ch != '_') { return false; } diff --git a/tools/pano_cli/main.cpp b/tools/pano_cli/main.cpp index a17e4cc..5835d72 100644 --- a/tools/pano_cli/main.cpp +++ b/tools/pano_cli/main.cpp @@ -577,7 +577,8 @@ std::string json_escape(std::string_view value) constexpr char hex[] = "0123456789abcdef"; std::string escaped; escaped.reserve(value.size()); - for (const unsigned char ch : value) { + for (const char raw : value) { + const auto ch = static_cast(raw); switch (ch) { case '"': escaped += "\\\"";