Skip to content

Preserve custom Xcode resources when updating Apple projects - #709

Merged
danoli3 merged 3 commits into
openframeworks:masterfrom
danoli3:preserve-xcode-resources
Nov 9, 2026
Merged

danoli3 merged 3 commits into
openframeworks:masterfrom
danoli3:preserve-xcode-resources

Conversation

@danoli3

@danoli3 danoli3 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Updating a project replaces its Xcode project file, which drops manually added icons, asset catalogs and Copy Bundle Resources entries even though the files remain on disk. Preserve those resource references and their target membership when updating Apple projects.

  • Merge resource file references, navigator groups, folder references and localized variant groups into the regenerated project. Keep per-target resource phases, per-file settings and platform filters; resolve UUID collisions and match regenerated targets by their scope.
  • Record generated resource defaults in .ofprojectgenerator/apple-settings.json. User additions stay separate from those defaults, removals of custom references and resource memberships remain removed, and resources from removed addons/templates are not restored. Existing projects without a resource baseline are handled conservatively.
  • Escape JSON template substitutions and use forward slashes in Xcode root paths, so generation on Windows handles drive paths correctly. Regression coverage also includes quotes and literal backslashes in OF paths.
  • Preserve custom entitlement-file references, their CODE_SIGN_ENTITLEMENTS setting and contents; verify sandbox booleans, networking permissions and application groups in of.entitlements.
  • Route generator-added resources through each actual target's PBXResourcesBuildPhase, creating a missing phase. Remove the hard-coded resource IDs that could create orphan objects. Recognize .icns and asset catalogs, and keep non-source resource files out of Compile Sources.
  • Display framework lists with spaces after commas, such as Foundation, AppKit, AVFoundation, Security, UserNotifications, NotificationCenter. Pasted lists accept spaces; formatting-only edits do not become CLI overrides.
  • GUI 0.122.0, CLI 0.127.0, Electron 45.2.3. Rebased on master after the ASAR packaging changes from Enable ASAR packaging with unpacked generators and writable preferences #707 merged.

The merge preserves resource metadata and leaves resource contents untouched. It supports PBXFileReference, PBXGroup and PBXVariantGroup resources on matching app targets. Custom targets/shared schemes and Xcode synchronized folder groups remain outside this merge.

Validation:

  • Native macOS arm64 Release build succeeds.
  • The original CLI 0.126.0 fails the custom-icon regression test; the updated CLI passes ten resource scenarios across osx, macos and ios. Covers OpenStep input on macOS, legacy projects, icons/catalogs, physical and virtual groups, localized additions/deletions, target membership, platform filters, per-file settings, template UUID changes, UUID collisions, repeated updates, generated resource phases, user removals, addon removal and invalid baselines.
  • Existing Apple settings tests pass for osx, macos and ios; addon/source/flag tests pass for osx, macos, ios and tvos.
  • All 13 GUI settings and packaging tests and all 62 macOS CLI argument cases pass. The GUI version and lockfile versions agree; both GUI and CLI advance relative to master.
  • Run the full Xcode resource regression suite on macOS and Linux. VS CI keeps its native builds, Visual Studio project tests, GUI tests and package checks. Test file I/O and subprocess output explicitly use UTF-8, including when these suites are run manually on Windows.

@danoli3
danoli3 marked this pull request as ready for review November 9, 2026 15:06
@danoli3
danoli3 force-pushed the preserve-xcode-resources branch from 003bb12 to 40d43a3 Compare November 9, 2026 15:22
@danoli3
danoli3 merged commit 35f04db into openframeworks:master Nov 9, 2026
6 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