libgit2/objective-git — pull request #399 by alexanderpine (2014-08-06 19:08:55+00:00)
Title: Converting ObjectiveGit to a Module

Well, after a lot of wrangling with Xcode 6, it appears I have finally figured out how to generate ObjectiveGit as a module for use with Swift and Objective-C. :tada: :confetti_ball:

_Note: 3rd party modules are a new feature in clang. Although beneficial but not necessary for Objective-C, they are required if a framework is to be imported into Swift._

To import the module into a new Xcode project, in addition to the changes made below, the following steps need to be taken each time:
- Add the repo as a git submodule (e.g. at `External/ObjectiveGit`), checkout the Swift branch, and run`script/bootstrap`.
- Drag`ObjectiveGitFramework.xcodeproj`into the project navigator.
- Set the Swift compiler import path build setting to `External/ObjectiveGit` (or wherever ObjectiveGit is located).
- Set the Allow Non-Modular Includes in Frameworks build setting to YES.
- Add a new Copy Files build phase, set the destination to Frameworks, and add `ObjectiveGit.framework` to that. (Due to the new module structure, you no longer need to set it as a target dependency or link it to your project.)
- Set the Header Search Paths build setting to the correct path for the libgit2 headers in your project. For example, if you added the submodule to your project as `External/ObjectiveGit`, you would set this build setting to `External/ObjectiveGit/External/libgit2/include`. If you see build errors saying that `git2/filter.h` cannot be found, then double-check that you set this setting correctly.
- Import the module just like any other: `import ObjectiveGit` in Swift or `@import ObjectiveGit;` in Objective-C.

And you should be off and running!

_Note: This is my first pull request to ObjectiveGit, so please suggest any dumb mistakes or changes to make it match the structure and style of the project. Thanks!_