Skip to content

Extract project settings to .xcconfig files#39

Open
sbeitzel wants to merge 2 commits intotwostraws:mainfrom
sbeitzel:feature/config_settings
Open

Extract project settings to .xcconfig files#39
sbeitzel wants to merge 2 commits intotwostraws:mainfrom
sbeitzel:feature/config_settings

Conversation

@sbeitzel
Copy link
Contributor

Overview

Build settings get extracted into a set of .xcconfig files. 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.hackingwithswift as 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.

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