Skip to content

Preserve user settings when updating Apple projects - #706

Merged
danoli3 merged 5 commits into
openframeworks:masterfrom
danoli3:preserve-apple-project-settings
Nov 9, 2026
Merged

danoli3 merged 5 commits into
openframeworks:masterfrom
danoli3:preserve-apple-project-settings

Conversation

@danoli3

@danoli3 danoli3 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Updating an existing Apple project can replace user settings with template defaults: Retina support, privacy descriptions, orientations, signing settings and other plist/build values can disappear. Preserve those edits while continuing to refresh the project for the selected openFrameworks checkout.

Behavior

  • Merge Project.xcconfig, Info.plist, entitlements and Xcode build settings for osx, macos and ios. Keep nested plist values, typed data, changed arrays, user deletions, per-configuration signing settings and target capabilities.
  • Record the generated defaults in .ofprojectgenerator/apple-settings.json. On subsequent updates, unchanged defaults follow the new template and user differences remain. Keep this file with the project in version control. The first update of an older project without a baseline conservatively retains existing values and adds missing defaults; it cannot identify which values came from an older template yet.
  • Refresh OF paths, SDK/platform settings, standard library selection and required build-script settings. Compiler language standards and deployment targets follow the current template/CoreOF minimums; higher user values remain. Preserve user architecture choices.
  • Regenerate addon flags and search paths, then retain user additions relative to the previous generated output. Removed addon entries are not restored from that baseline. Keep explicit version/build/bundle-id CLI options authoritative.
  • Populate the GUI version, build, bundle ID, custom defines, system frameworks and system libraries from the existing project. Native Apple metadata takes priority over stale config.make values. Unedited fields remain implicit so target/configuration differences are preserved; deliberate edits replace the corresponding user settings.
  • Preserve user-added SDK framework/library references per target, including weak-link settings and platform filters. Keep existing project workspaces and never copy them back into OF templates.
  • Pin Electron to 45.2.3, including the Linux packager version, and include the new project-settings reader in packaged apps. GUI version is 0.120.0; CLI version is 0.125.0.
  • Read OpenStep projects saved by Xcode and binary plists on macOS. Other hosts support JSON projects and XML plists and stop safely on unsupported formats. Validate settings before template copies and propagate create/save failures to the CLI exit status.

This branch includes merged #705. Its PROJECT_DEFINES values are collected before copying files and applied after discovering the current template's target/configuration IDs, so defines also reach renamed configuration IDs and additional app targets. Its local-addon source-path fixes are retained.

Custom schemes and extra user-created targets remain outside this settings merge; project structure and shared schemes are still regenerated.

Validation

  • Native macOS arm64 Release build succeeds (MACOSX_DEPLOYMENT_TARGET=12.0 for the installed SDK).
  • New end-to-end preservation tests pass for osx, macos, and ios: generate, customize, upgrade template defaults and configuration UUIDs, update, and update again. Covers Retina, privacy strings, orientations, nested/typed plist values, signing/capabilities, custom flags and architectures, stale addon flags, required minimums, explicit CLI overrides, OpenStep/binary formats, legacy projects and invalid input.
  • Existing addon flag/source tests pass for osx, macos, ios, and tvos.
  • Existing macOS command-line argument suite: 62 cases, 0 failures.
  • Eight GUI settings tests pass: native metadata precedence, xcconfig inheritance, OpenStep/binary reading, platform selection, custom define filtering, field population, keeping unedited values implicit, and deliberate edits/clears.
  • Add the preservation suite to macOS/Linux CI and GUI settings tests to macOS/Linux/Windows CI.
  • Local macOS arm64 app packaged with Electron 45.2.3 for manual testing; visual menu testing is pending.

@danoli3
danoli3 marked this pull request as ready for review November 9, 2026 01:55
@danoli3

danoli3 commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

Code developed ages ago, and finished with QWEN open source model overnight / Codex for review and testing

@danoli3
danoli3 merged commit c46de0a into openframeworks:master Nov 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant