Extract project settings to .xcconfig files#39
Open
sbeitzel wants to merge 2 commits intotwostraws:mainfrom
Open
Extract project settings to .xcconfig files#39sbeitzel wants to merge 2 commits intotwostraws:mainfrom
sbeitzel wants to merge 2 commits intotwostraws:mainfrom
Conversation
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.
Overview
Build settings get extracted into a set of
.xcconfigfiles. These files are added to the project. We add a setup script to create a developer-specific settings file at a well-known location outside the ShipShape repository.Rationale
Having to exclude the Xcode project file from git to prevent accidental checkin adds some extra friction for contributors who are adding new files (for instance, for adding access to new endpoints). Putting the developer team ID and the organization prefix in a configuration file outside the repository allows individual contributors to work on the project without risking checking in their identifiers to the repo. Rather than inventing our own solution to the problem, this PR adopts the approach taken by another long-lived and thriving open source project (NetNewsWire).
Details of Note
The way Xcode reads configuration files and the way they are applied, the last file to write to a particular variable wins.
The inclusion of the developer-specific configuration file is conditional, meaning that if that file does not exist, processing of the include files will continue. This is the reason that
com.hackingwithswiftas an organization prefix is not included in the configuration files: we don't want someone who checks out the project and builds it without running the setup script to be able to poach the Bundle ID from Paul.