feat: support new Xcode 16 XCBuildConfiguration format#1037
feat: support new Xcode 16 XCBuildConfiguration format#1037fortmarek merged 6 commits intotuist:mainfrom
Conversation
| [*] | ||
| indent_style = space | ||
| indent_size = 2 | ||
| indent_size = 4 |
There was a problem hiding this comment.
I wasn't sure about this, but I had to change this to get the correct indentation locally in Xcode. Maybe someone can explain why it should be 2?
|
Is there any progress on this? :D |
PR tuist#1037 (tuist#1037) emits the synchronized root group's `path` as the `baseConfigurationReferenceAnchor` comment. The sibling `baseConfigurationReference` encoder uses `PBXFileElement.fileName()`, which returns `name ?? path`, matching what Xcode emits. For sync groups carrying both `name` and `path` (e.g. wcios's `config` group with `name = config`, `path = ../config`), the divergence rewrites every anchor comment on round-trip, producing diff noise that defeats the purpose of vendoring the encoder fix at all. The added test reproduces the divergence using a fixture sync group with both fields set. --- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Code Opus 4.7 (1M context) <noreply@anthropic.com>
PR tuist#1037 (tuist#1037) adds two stored properties to `XCBuildConfiguration` (`baseConfigurationReferenceAnchor`, `baseConfigurationReferenceRelativePath`) but does not regenerate `Equality.generated.swift`. `Templates/Equality.stencil` iterates over `storedVariables`, so the regenerated output would already include these fields. Adding the two comparisons by hand mirrors what Sourcery would emit and avoids reintroducing a Sourcery toolchain dependency just to update two lines. Without this, two configurations differing only in anchor or relativePath compare equal, which masks structural divergence in callers that rely on `isEqual` for round-trip checks. --- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Code Opus 4.7 (1M context) <noreply@anthropic.com>
The existing `baseConfiguration` setter and PR tuist#1037's new `baseConfigurationAnchor` setter both wrap the assignment in `if let newValue`, silently dropping `nil`. That's incomplete behavior: the public mutable-property contract leads callers to expect `x.baseConfiguration = nil` to clear, not no-op. The gap matters more during sync-folder migrations: to convert a configuration from `baseConfigurationReference` to anchor+relativePath (or vice versa), callers need to clear the obsolete attachment first. Without nil-as-clear support that's only reachable through the package-internal stored properties. Both setters now mirror the optional reference assignment directly, matching what the property type already promises. Reference: tuist#1037 --- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Code Opus 4.7 (1M context) <noreply@anthropic.com>
|
Thank you @johnrbent for working on this. It's unfortunate it's been sitting here all this time, but such is the fate with many open source projects. Maintainers are busy. One has to be thankful for the tools to exist in the first place and for the open source community to be so collaborative. I cherry picked your changes in a personal fork because I run in an issue that your work addresses. Thanks again. |
- Revert unrelated `.editorconfig` indent_size change - Split XCBuildConfiguration init into two dedicated initializers (legacy PBXGroup form + Xcode 16 anchor/relative-path form) to make the mutually-exclusive reference styles explicit and document them - Reject partial anchor data in the decoder with DecodingError.dataCorrupted instead of silently dropping the field - Fix doc-comment typos - Add tests covering the partial-anchor-data decoder failure paths Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Hey @johnrbent, thanks a lot for the contribution! I pushed a follow-up commit (145093a) to address a few items from my review. Happy to revert any of these if you'd prefer to handle them yourself. Summary of what changed and why:
|
Fall back to the original behaviour: if only one of `baseConfigurationReferenceAnchor` and `baseConfigurationReferenceRelativePath` is present, silently skip them and try `baseConfigurationReference` instead, rather than throwing. Drop the two tests that asserted the removed throwing behaviour. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Quick follow-up — pushed bb28852 to drop the partial-anchor-data throwing behaviour and the two tests that asserted it. Decoder is back to the original silent fall-through, so an anchor without its relative-path partner (or vice-versa) is just skipped, same as before. |
|
Thanks for the PR! Sorry that this has been left unattended for this long. LGTM once the CI is green. |
Resolves #852
Short description 📝
Adds support for changes to the
XCBuildConfigurationrepresentation of xcconfig files contained within a file-system synchronized root group.Solution 📦
Instead of a single
baseConfigurationReference, these xcconfig files are represented by a pair of:baseConfigurationReferenceAnchor: reference to the synced root group.baseConfigurationReferenceRelativePath: relative path to the file from the root group.*config files within a PBXGroup are still represented by the
baseConfigurationReferenceImplementation 👩💻👨💻
XCBuildConfigurationtype following existing patterns forbaseConfigurationReference(This is my first contribution to the project. I'm happy to make changes if needed)