diff --git a/cmake/PanoPainterPlatformTargets.cmake b/cmake/PanoPainterPlatformTargets.cmake index 4257644..326cbac 100644 --- a/cmake/PanoPainterPlatformTargets.cmake +++ b/cmake/PanoPainterPlatformTargets.cmake @@ -12,6 +12,13 @@ pp_add_powershell_automation_target(panopainter_platform_build_android_assets -Presets android-arm64,android-x64,android-quest-arm64,android-focus-arm64 -Targets pp_assets) +pp_add_powershell_automation_target(panopainter_platform_build_vcpkg_ui_core + COMMENT "Build the Windows vcpkg-backed UI core dependency boundary." + ARGUMENTS + -File "${CMAKE_CURRENT_SOURCE_DIR}/scripts/automation/platform-build.ps1" + -Presets windows-msvc-vcpkg-headless + -Targets pp_ui_core,pp_ui_core_layout_xml_tests) + pp_add_powershell_automation_target(panopainter_platform_build_apple_remote COMMENT "Run remote Apple compile validation for macOS, iOS simulator, and iOS device." ARGUMENTS diff --git a/docs/modernization/build-inventory.md b/docs/modernization/build-inventory.md index 51b6d56..12b9df1 100644 --- a/docs/modernization/build-inventory.md +++ b/docs/modernization/build-inventory.md @@ -71,6 +71,7 @@ $env:VCPKG_ROOT = "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\vc cmake --preset windows-msvc-vcpkg-headless powershell -ExecutionPolicy Bypass -File scripts\automation\platform-build.ps1 -Presets windows-msvc-vcpkg-headless ctest --preset desktop-fast-vcpkg --build-config Debug +cmake --build --preset windows-msvc-default --config Debug --target panopainter_platform_build_vcpkg_ui_core cmake --preset android-arm64 powershell -ExecutionPolicy Bypass -File scripts\automation\platform-build.ps1 -Presets android-arm64 powershell -ExecutionPolicy Bypass -File scripts\automation\android-legacy-package-build.ps1 -Packages standard @@ -99,6 +100,10 @@ Known local toolchain state: - Local Visual Studio generator selected by CMake: Visual Studio 17 2022 - Bundled vcpkg: `C:\Program Files\Microsoft Visual Studio\2022\Community\VC\vcpkg` (`vcpkg version` reports 2025-11-19) +- External vcpkg: `D:\vcpkg` is currently resolved by + `scripts/automation/platform-build.ps1` when `VCPKG_ROOT` is already set on + this host; the wrapper falls back to bundled Visual Studio vcpkg roots when + needed. - Android SDK: `C:\Users\omara\AppData\Local\Android\Sdk` - Android NDK: latest SDK Manager package selected by `scripts/automation/android-sdk-env.ps1`; currently @@ -200,7 +205,8 @@ powershell -ExecutionPolicy Bypass -File scripts\automation\apple-remote-build.p root CMake package targets yet. - Root CMake exposes non-default platform validation targets: `panopainter_platform_build_headless`, - `panopainter_platform_build_android_assets`, and + `panopainter_platform_build_android_assets`, + `panopainter_platform_build_vcpkg_ui_core`, and `panopainter_platform_build_apple_remote`. These targets call the existing platform automation scripts from CMake and keep platform validation discoverable from the CMake target graph while app/package target migration remains open. @@ -610,7 +616,9 @@ powershell -ExecutionPolicy Bypass -File scripts\automation\apple-remote-build.p of owning active WGL context/pixel-format attribute literals in `main.cpp`. - `windows-msvc-vcpkg-headless` validates manifest install/configure/build/test for the current headless component matrix; see DEBT-0007 for remaining app - and platform triplet migration. + and platform triplet migration. Root CMake target + `panopainter_platform_build_vcpkg_ui_core` focuses that gate on the + vcpkg-backed `pp_ui_core`/tinyxml2 boundary and `pp_ui_core_layout_xml_tests`. - `scripts/automation/analyze.*` runs shader validation plus a renderer-boundary guard that reports JSON and fails if active non-backend source code reintroduces raw `GL_*`/`WGL_*` constants outside the allowed diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index d1af8b7..acb2286 100644 --- a/docs/modernization/debt.md +++ b/docs/modernization/debt.md @@ -286,6 +286,11 @@ agent or engineer to remove them without reconstructing context from chat. `panopainter_windows_app_package_smoke`, which calls the full Windows `package-smoke` command from CMake so the app executable/runtime payload check and Windows AppX blocker matrix are available from the CMake target graph. +- 2026-06-05: DEBT-0007 was narrowed. `platform-build.ps1` now resolves + `VCPKG_ROOT` for vcpkg presets from the environment or bundled Visual Studio + installs, reports the selected vcpkg root in JSON, and root CMake exposes + `panopainter_platform_build_vcpkg_ui_core` to validate the vcpkg-backed + `pp_ui_core`/tinyxml2 boundary through `pp_ui_core_layout_xml_tests`. - 2026-06-04: DEBT-0036 was narrowed again. Canvas stroke commit, thumbnail, and object-draw history paths now query saved blend state through tested `pp_renderer_gl` capability-state dispatch; CanvasLayer equirect @@ -307,7 +312,7 @@ agent or engineer to remove them without reconstructing context from chat. | DEBT-0003 | Open | Modernization | Existing singletons remain during initial split; `App::open_document`, `App::request_close`, `App::share_file`, `App::cloud_upload`, `App::cloud_upload_all`, `App::cloud_browse`, `App::rec_start`, `App::rec_stop`, `App::rec_clear`, `App::rec_export`, `App::rec_loop`, `App::update_ui_observer`, `App::render_task*`, `App::ui_task*`, `App::render_thread_*`, `App::ui_thread_*`, file-menu save actions, `NodeCanvas` canvas hotkeys, new/open/browse dirty-document workflow prompts, new-document target/resolution/overwrite decisions, save-as document file naming and overwrite decisions, save-version target decisions, export start/menu/target naming/path/message/report decisions, share-file saved-path decisions, file/image/save/directory picker selected-path decisions, display-file external-open decisions, virtual-keyboard visibility decisions, recording lifecycle/export progress/worker decisions, cloud-upload prompt/save-before-upload decisions, cloud-browse availability and selected-download decisions, bulk cloud-upload progress decisions, tools/options app preference decisions, app status/display and renderer diagnostic decisions, app dialog metadata decisions, app frame/UI-observer decisions, app thread/task orchestration decisions, document resize decisions, layer rename/menu decisions, Tools menu/panel decisions, About menu/diagnostic decisions, main toolbar/status decisions, `pano_cli classify-open`, `pano_cli plan-open-route`, `pano_cli plan-file-menu`, `pano_cli plan-new-document`, `pano_cli plan-document-file`, `pano_cli plan-document-version`, `pano_cli plan-export-start`, `pano_cli plan-export-menu`, `pano_cli plan-export-target`, `pano_cli plan-export-message`, `pano_cli plan-export-report`, `pano_cli plan-recording-session`, `pano_cli plan-app-preferences`, `pano_cli plan-app-status`, `pano_cli plan-app-dialog`, `pano_cli plan-app-thread`, `pano_cli plan-tools-menu`, `pano_cli plan-tools-panel`, `pano_cli plan-about-menu`, `pano_cli plan-main-toolbar`, `pano_cli plan-document-resize`, `pano_cli plan-layer-rename`, `pano_cli plan-layer-menu`, `pano_cli plan-canvas-hotkey`, `pano_cli plan-share-file`, `pano_cli plan-picked-path`, `pano_cli plan-display-file`, `pano_cli plan-keyboard-visibility`, `pano_cli plan-cloud-upload`, `pano_cli plan-cloud-browse`, `pano_cli plan-cloud-upload-all`, and `pano_cli simulate-app-session` now consume pure `pp_app_core` route/session/export/recording/preferences/status/dialog/thread/share/platform-I/O/display/keyboard/cloud/resize/layer/tools/about/toolbar/canvas-command contracts, but document creation/loading, brush import execution, saving, export execution, tools/options UI execution, Tools panel creation/execution, About dialog/diagnostic execution, toolbar/status dialog/history/canvas execution, app dialog node creation, status/display UI rendering, renderer diagnostic capability adaptation, app task/thread execution, UI observer parent walking/callback execution, document resize execution, layer rename/menu execution, settings persistence, platform share service execution, picker service execution, display-file service execution, keyboard service execution, recording/MP4/PBO execution, cloud upload execution, and cloud browse/download execution still reach legacy `Canvas::I`/UI/network/video/platform singletons | Avoid behavior changes while introducing component boundaries | App launch and component tests; `pp_app_core_document_route_tests`; `pp_app_core_file_menu_tests`; `pp_app_core_document_export_tests`; `pp_app_core_document_recording_tests`; `pp_app_core_app_frame_tests`; `pp_app_core_app_preferences_tests`; `pp_app_core_app_status_tests`; `pp_app_core_app_dialog_tests`; `pp_app_core_app_thread_tests`; `pp_app_core_tools_menu_tests`; `pp_app_core_about_menu_tests`; `pp_app_core_main_toolbar_tests`; `pp_app_core_document_resize_tests`; `pp_app_core_document_layer_tests`; `pp_app_core_document_sharing_tests`; `pp_app_core_document_platform_io_tests`; `pp_app_core_document_cloud_tests`; `pp_app_core_document_session_tests`; `pp_app_core_canvas_hotkey_tests`; `pano_cli classify-open --path D:/Paint/demo.ppi`; `pano_cli plan-open-route --path D:/Paint/demo.ppi --unsaved`; `pano_cli plan-file-menu --command save-as`; `pano_cli plan-new-document --work-dir D:/Paint --name demo --resolution-index 3 --target-exists`; `pano_cli plan-document-file --work-dir D:/Paint --name demo --target-exists`; `pano_cli plan-document-version --directory D:/Paint --doc-name demo.01 --existing-path D:/Paint/demo.02.ppi`; `pano_cli plan-export-start --requires-license --demo`; `pano_cli plan-export-menu --kind animation-mp4 --demo`; `pano_cli plan-export-target --kind file --work-dir D:/Paint --doc-name demo --extension .png`; `pano_cli plan-export-message --kind timelapse --destination success`; `pano_cli plan-export-report --kind license-disabled`; `pano_cli plan-recording-session --running --frame-count 12`; `pano_cli plan-recording-session --running --no-encoder`; `pano_cli plan-app-preferences --ui-scale 1.5 --display-density 2 --current-scale 1.6 --scale-option 1 --scale-option 1.5 --rtl`; `pano_cli plan-app-status --doc-name demo --unsaved --resolution 2048 --resolution-index 3 --zoom 1.25 --history-bytes 1572864 --recording-running --encoder-available --encoded-frames 12 --framebuffer-fetch --float32 --float32-linear --float16`; `pano_cli plan-app-dialog --kind message --cancel`; `pano_cli plan-app-frame`; `pano_cli plan-app-thread --kind ui-loop --live-reload`; `pano_cli plan-tools-menu --command shortcuts`; `pano_cli plan-tools-panel --panel layers`; `pano_cli plan-about-menu --command news --version-major 2 --version-minor 5 --version-fix 7`; `pano_cli plan-main-toolbar --command undo --undo-count 2`; `pano_cli plan-document-resize --current-resolution 2048 --selected-resolution-index 4`; `pano_cli plan-layer-rename --old-name Base --new-name Paint`; `pano_cli plan-layer-menu --command merge --current-index 2 --lower-name Paint`; `pano_cli plan-canvas-hotkey --event key-up --key z --ctrl --undo-count 2`; `pano_cli plan-share-file --path D:/Paint/demo.ppi`; `pano_cli plan-picked-path --path D:/Paint/demo.ppi`; `pano_cli plan-display-file --path D:/Paint/export.png`; `pano_cli plan-keyboard-visibility --visible`; `pano_cli plan-cloud-upload --new-document --unsaved`; `pano_cli plan-cloud-browse --selected-file demo.ppi`; `pano_cli plan-cloud-upload-all --file-count 3`; `pano_cli simulate-app-session --unsaved --save-intent save-dirty-version`; `pano_cli simulate-app-session --no-canvas`; `ctest --preset desktop-fast --build-config Debug` | Replace singleton reaches with context/service injection at component boundaries | | DEBT-0004 | Open | Modernization | Android, Linux, WebGL, Apple, and AppX build files remain platform-specific until root CMake alignment reaches them | Prevent platform regressions during incremental migration; raw Windows `.sln/.vcxproj` files were removed on 2026-05-31 by user decision | `cmake --preset windows-msvc-default`; platform-specific configure/build smoke checks as each platform is migrated | Root CMake owns every platform source list and package path | | DEBT-0005 | Open | Modernization | Temporary local CTest harness is used before Catch2 is wired through vcpkg | `vcpkg` is not currently on PATH, but headless tests need to run now | `ctest --preset desktop-fast --build-config Debug` | Replace `tests/test_harness.h` tests with Catch2 tests once vcpkg toolchain/presets are validated | -| DEBT-0007 | Open | Modernization | `vcpkg.json` and `windows-msvc-vcpkg-headless` are validated for the headless Windows component matrix, but app targets still use vendored libraries and Android/Apple triplets are not proven | Dependency migration must stay incremental while SDK/patched/vendor dependencies remain in use | `$env:VCPKG_ROOT="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\vcpkg"; cmake --preset windows-msvc-vcpkg-headless`; `ctest --preset desktop-fast-vcpkg --build-config Debug` | Component targets consume vcpkg packages where reliable and desktop app, Android, and Apple triplets are validated or explicitly documented as permanent vendor exceptions | +| DEBT-0007 | Open | Modernization | `vcpkg.json` and `windows-msvc-vcpkg-headless` are validated for the headless Windows component matrix, and root CMake now exposes a focused `panopainter_platform_build_vcpkg_ui_core` target for the vcpkg-backed `pp_ui_core`/tinyxml2 boundary, but app targets still use vendored libraries and Android/Apple triplets are not proven | Dependency migration must stay incremental while SDK/patched/vendor dependencies remain in use | `cmake --preset windows-msvc-vcpkg-headless`; `ctest --preset desktop-fast-vcpkg --build-config Debug`; `cmake --build --preset windows-msvc-default --config Debug --target panopainter_platform_build_vcpkg_ui_core` | Component targets consume vcpkg packages where reliable and desktop app, Android, and Apple triplets are validated or explicitly documented as permanent vendor exceptions | | DEBT-0008 | Open | Modernization | `windows-msvc-default` preset is used for local validation because the VS 2026 generator is not installed here | The target VS 2026 preset must remain, but this machine configures with Visual Studio 17 2022 | `cmake --preset windows-msvc-default`; `ctest --preset desktop-fast --build-config Debug` | Validate `windows-vs2026-x64` on a machine with Visual Studio 2026 installed and make it the default Windows validation preset | | DEBT-0009 | Open | Modernization | Android root CMake validation currently builds headless targets only, while retained standard/Quest/Focus package CMake paths now have a refreshed CMake 3.10/C++23 baseline outside root CMake; automation selects the newest installed SDK Manager NDK/CMake pair before configure; root CMake exposes non-default platform-build and retained native package validation targets | Platform app entrypoints still live in legacy Gradle/CMake projects and need Phase 6 alignment | `powershell -ExecutionPolicy Bypass -File scripts\automation\platform-build.ps1 -Presets android-arm64`; `cmake --build --preset android-x64`; `cmake --build --preset android-quest-arm64`; `cmake --build --preset android-focus-arm64`; `cmake --build --preset windows-msvc-default --config Debug --target panopainter_platform_build_android_assets`; `powershell -ExecutionPolicy Bypass -File scripts\automation\android-legacy-package-build.ps1 -Packages standard`; `powershell -ExecutionPolicy Bypass -File scripts\automation\android-legacy-package-build.ps1 -Packages quest,focus -ConfigureOnly`; `powershell -ExecutionPolicy Bypass -File scripts\automation\package-smoke.ps1 -ReadinessOnly -AndroidNativeChecks -PackageKinds android-standard-apk,android-quest-apk,android-focus-apk`; `cmake --build --preset windows-msvc-default --config Debug --target panopainter_android_native_package_smoke` | Android standard, Quest, and Focus/Wave package targets consume shared component targets and have package smoke commands | | DEBT-0010 | Open | Modernization | `pp_document` is a pure layer/frame/document/undo-history model with alpha-lock metadata, snapshot construction, per-layer frame metadata, renderer-free RGBA8 face payload storage, snapshot-embedded face-payload validation, renderer-free alpha8 selection-mask storage, PPI import/export helpers, and stroke-script-to-face-payload CLI automation, but it is not yet wired to legacy `Canvas`, legacy save, or legacy action commands | Keep extraction incremental while preserving app behavior | `ctest --preset desktop-fast --build-config Debug`; `pano_cli create-document --width 64 --height 32 --layers 2`; `pano_cli load-project --path tests\data\projects\minimal-project.ppi`; `pp_document_tests`; `pp_document_ppi_import_tests`; `pp_document_ppi_export_tests`; `pano_cli_simulate_document_edits_smoke`; `pano_cli_simulate_document_export_smoke`; `pano_cli_save_document_project_roundtrip_smoke`; `pano_cli_apply_stroke_script_roundtrip_smoke`; `pano_cli_apply_stroke_script_rejects_tiny_canvas` | Legacy document behavior is represented by `pp_document` tests and the app consumes it through a boundary/facade | diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index 5720131..c1f9d2f 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -298,7 +298,11 @@ exist. `windows-clangcl-asan` now configures as a headless Ninja/clang-cl ASan preset and uses the release MSVC runtime required by clang-cl ASan, but local ASan builds are blocked by DEBT-0014 until Clang and the selected MSVC STL are compatible. Dependency migration is not complete until remaining component -dependencies and mobile/Apple triplets are validated. +dependencies and mobile/Apple triplets are validated. Root CMake now also +exposes `panopainter_platform_build_vcpkg_ui_core`, a focused automation target +that resolves `VCPKG_ROOT` through the platform-build wrapper and validates the +vcpkg-backed `pp_ui_core`/tinyxml2 XML test boundary from the CMake target +graph. Implementation tasks: @@ -1386,7 +1390,8 @@ Focus/Wave arm64. The shell wrapper now mirrors the PowerShell wrapper's multi-preset behavior and reports one structured result array. Root CMake now also exposes non-default platform validation targets: `panopainter_platform_build_headless`, -`panopainter_platform_build_android_assets`, and +`panopainter_platform_build_android_assets`, +`panopainter_platform_build_vcpkg_ui_core`, and `panopainter_platform_build_apple_remote`; the platform-build self-test guards those target names and the wrapper matrix now includes `pp_app_core_app_dialog_tests` with the rest of the CMake test executables. @@ -2408,11 +2413,14 @@ Results: still-blocked Windows AppX package state. - Root CMake now exposes platform validation targets for the default headless platform-build sweep, the Android standard/Quest/Focus root CMake asset - component sweep, and the remote Apple compile gate. `cmake --build --preset + component sweep, the vcpkg-backed UI core dependency boundary, and the + remote Apple compile gate. `cmake --build --preset windows-msvc-default + --config Debug --target panopainter_platform_build_android_assets` validated + `pp_assets` across Android arm64, Android x64, Quest arm64, and Focus/Wave + arm64 with the latest SDK-managed NDK/CMake pair; `cmake --build --preset windows-msvc-default --config Debug --target - panopainter_platform_build_android_assets` validated `pp_assets` across - Android arm64, Android x64, Quest arm64, and Focus/Wave arm64 with the latest - SDK-managed NDK/CMake pair. + panopainter_platform_build_vcpkg_ui_core` validated `pp_ui_core` and + `pp_ui_core_layout_xml_tests` through the vcpkg tinyxml2 preset. - 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 f103ad4..137979d 100644 --- a/scripts/automation/platform-build.ps1 +++ b/scripts/automation/platform-build.ps1 @@ -94,11 +94,50 @@ function Expand-ArgumentList { return $expanded } +function Get-VcpkgRoot { + $candidates = @() + if ($env:VCPKG_ROOT) { + $candidates += $env:VCPKG_ROOT + } + + $programFiles = @($env:ProgramFiles, ${env:ProgramFiles(x86)}) | Where-Object { $_ } + $vsYears = @("2026", "2022") + $vsEditions = @("Community", "Professional", "Enterprise", "BuildTools", "Preview") + foreach ($root in $programFiles) { + foreach ($year in $vsYears) { + foreach ($edition in $vsEditions) { + $candidates += (Join-Path $root "Microsoft Visual Studio\$year\$edition\VC\vcpkg") + } + } + } + + foreach ($candidate in $candidates) { + if ($candidate -and (Test-Path -LiteralPath (Join-Path $candidate "vcpkg.exe") -PathType Leaf)) { + return (Resolve-Path -LiteralPath $candidate).Path + } + } + + throw "VCPKG_ROOT was not set and no Visual Studio bundled vcpkg root was found." +} + +function Set-VcpkgRootEnvironment { + $vcpkgRoot = Get-VcpkgRoot + $env:VCPKG_ROOT = $vcpkgRoot + return [ordered]@{ + vcpkgRoot = $vcpkgRoot + vcpkgCommand = Join-Path $vcpkgRoot "vcpkg.exe" + } +} + $Presets = @(Expand-ArgumentList -Values $Presets) $Targets = @(Expand-ArgumentList -Values $Targets) $cmakeCommand = "cmake" $androidToolchain = $null +$vcpkgToolchain = $null +if ($Presets | Where-Object { $_ -like "*vcpkg*" }) { + $vcpkgToolchain = Set-VcpkgRootEnvironment +} if ($Presets | Where-Object { $_ -like "android-*" }) { . "$PSScriptRoot\android-sdk-env.ps1" $androidToolchain = Set-AndroidSdkToolchainEnvironment @@ -152,6 +191,7 @@ $elapsed = [int]((Get-Date) - $started).TotalMilliseconds exitCode = $overallExitCode elapsedMs = $elapsed androidToolchain = $androidToolchain + vcpkgToolchain = $vcpkgToolchain results = $results } | ConvertTo-Json -Compress -Depth 6 diff --git a/scripts/dev/check_platform_build_targets.py b/scripts/dev/check_platform_build_targets.py index 06b4823..9ce236b 100644 --- a/scripts/dev/check_platform_build_targets.py +++ b/scripts/dev/check_platform_build_targets.py @@ -33,6 +33,7 @@ REQUIRED_ANDROID_PRESETS = [ EXPECTED_CMAKE_PLATFORM_TARGETS = [ "panopainter_platform_build_headless", "panopainter_platform_build_android_assets", + "panopainter_platform_build_vcpkg_ui_core", "panopainter_platform_build_apple_remote", ]