Merge conflicts are not fun to deal with, sometimes they can be downright nasty to resolve. This can be especially true when they happen on the project.
Conflicts on this file are more tricky to resolve than most because it governs the contents of your project and actions taken during the build process. This can be non-trivial to deal with on simple project files, and downright crushing when it happens on complex projects.
As part of my job I maintain our project files and build systems. This post is about some of the methods I use to avoid causing file conflicts on pbxproj files altogether. Within the project. This root object defines the way the files are organized in Xcode's Navigator panel, as well as a list of targets that are defined in the project. The more targets you have per project the more files you will have in total, and if any of those files are used in multiple targets the greater the likelihood of a merge conflict occuring.
The most major thing to avoid is having multiple targets that build the same product in slightly different ways. Having multiple targets that share the same files and settings within the project. Since each of these files are identifier by a unique identifier, bad merges can happen that will turn your project file to garbage due to some unfortunately matching logic on these identifier strings.
If you need to build a framework or library for multiple platforms, then you should be using schemes with different build configurations set to alter the values of your build settings to do this rather than duplicate the target multiple times. This is the purpose for scheme and build configuration pairings within the Xcode build system. Each build configuration allows an xcconfig file to be set per target to import custom settings to use. This is where you should be storing the platform-specific values for building the target.
By removing duplicated targets you drastically cut down on the footprint of the file and amount of places where a bad merge could happen and break your project file. You can do that by using the following command:. This file holds the list of all the files in the project, settings of targets and which files belong to which targets.
It's probably the meatiest file in project bundle. You should not ignore this file. There are few points for this:. Login using GitHub Register. Ask a Question. Embed What would you like to do? Embed Embed this gist in your website. Share Copy sharable link for this gist. Learn more about clone URLs. Download ZIP. This file contains 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. Learn how we can help you understand the current state of your code quality, speed up delivery times, improve developer happiness, and level up your user experience. Here are some ways that we can bridge the gap. Add the following contents to a.
OS X Finder.
0コメント