build: add Local.xcconfig override for per-developer signing#1037
Closed
build: add Local.xcconfig override for per-developer signing#1037
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1033.
Summary
Move per-developer signing values out of
project.pbxprojand into a gitignoredLocal.xcconfig. Removes thegit update-index --skip-worktree TablePro.xcodeproj/project.pbxprojworkaround documented after #1028. Standard Apple xcconfig pattern (project-level base configuration + optional include of a developer-local file).What this PR delivers (committed files only)
Configurations/Shared.xcconfig: project-level defaults forDEVELOPMENT_TEAM,PRODUCT_BUNDLE_IDENTIFIER,CODE_SIGN_ENTITLEMENTS. Final line is#include? "../Local.xcconfig"(Apple's documented optional-include syntax).Local.xcconfig.example: copy-and-edit template, three commented overrides..gitignore: ignoresLocal.xcconfig.CONTRIBUTING.md: rewrites the personal-team section to acp+ edit + build flow. No more pbxproj skip-worktree hack.What you (maintainer) need to do in Xcode before merging
The override only takes effect after the project file is rewired. xcconfig values cannot override target-level Build Settings; the existing target-level entries must be removed so they fall back to the xcconfig.
Wire
Configurations/Shared.xcconfigat the project level:DebugandRelease, set "Based on Configuration File" →Configurations/Shared.Remove redundant target-level overrides (so the xcconfig flows through):
DEVELOPMENT_TEAM(currentlyD7HJ5TFYCU)PRODUCT_BUNDLE_IDENTIFIER(currentlycom.TablePro)CODE_SIGN_ENTITLEMENTS(currentlyTablePro/TablePro.entitlements)DEVELOPMENT_TEAM(both configs).MySQLDriver,PostgreSQLDriver, etc.). They have unique bundle IDs (com.TablePro.MySQLDriveretc.) that must stay per-target. TheirDEVELOPMENT_TEAM = ""already inherits from the project.Verify:
D7HJ5TFYCUteam. Should produce a binary signed exactly as before (noLocal.xcconfigpresent, defaults fromShared.xcconfigapply).codesign -d --entitlements - build/Debug/TablePro.appshould still showD7HJ5TFYCU.com.TablePro.sharedas the keychain access group.The pbxproj diff from these changes is small (~16 deleted lines, ~4 baseConfigurationReference additions). Worth a careful diff review before committing.
Why this is the canonical Apple pattern
#include?(with?) is documented Xcode syntax for optional includes. Used in Apple's own sample code (Backyard Birds, Food Truck).--skip-worktree, no shadow files. Just the standard build settings inheritance chain: SDK defaults → project xcconfig (Shared) → optional Local.xcconfig override → target build settings (left untouched for plugins).Caveats
git update-index --skip-worktree TablePro.xcodeproj/project.pbxprojshould undo withgit update-index --no-skip-worktree TablePro.xcodeproj/project.pbxprojbefore pulling this branch.CHANGELOG
Not updated: this is a build/contributor-tooling change, not a runtime feature. The previous PR #1028 (which this supersedes for the personal-team flow) is still in
[Unreleased]. Happy to add a Changed entry if you want one.Test plan
swiftlint lint --strict: no Swift changes.codesign -d --entitlements -matches main).cp Local.xcconfig.example Local.xcconfig→ setDEVELOPMENT_TEAM→ build succeeds.