ObjectiveGit
ObjectiveGit provides Cocoa bindings to thelibgit2 library. Not all libgit2 features are available yet. If you run across something missing,please consider contributing a pull request! Getting StartedTo start building the framework, you must install the required dependencies,xctool andcmake. We recommend usingHomebrew to install these two tools. Once you have the dependencies you should clone this repository and then runscript/bootstrap . This will automatically pull down and install any otherdependencies. Note that the bootstrap script automatically installs some libraries thatObjectiveGit relies upon, using Homebrew. If you want this behavior, pleasemake sure you have Homebrew installed. To develop ObjectiveGit on its own, open the ObjectiveGitFramework.xcworkspace file.Note that Xcode 6.3 is required to build the framework and run unit tests.Projects that must use an older version of Xcode can useCarthage to install pre-built binariesor download them from the releases. Importing ObjectiveGit on OS XIt is simple enough to add the ObjectiveGit framework to a desktop applicationproject. An example of this is theCommitViewer example on GitHub. In summary: - Drag the
ObjectiveGitFramework.xcodeproj file into the project navigator. - Add the ObjectiveGit framework as a target dependency of your application.
- Link your application with
ObjectiveGit.framework . - Add a new "Copy Files" build phase, set the destination to "Frameworks" andadd
ObjectiveGit.framework to that. This will package the framework withyour application as an embedded private framework. - Set the “Header Search Paths” (
HEADER_SEARCH_PATHS ) build setting to thecorrect path for the libgit2 headers in your project. For example, if youadded the submodule to your project as External/ObjectiveGit , you wouldset this build setting to External/ObjectiveGit/External/libgit2/include .If you see build errors saying that git2/filter.h cannot be found, thendouble-check that you set this setting correctly. - Don't forget to
#import <ObjectiveGit/ObjectiveGit.h> as you would with anyother framework.
Importing ObjectiveGit on iOSGetting started is slightly more difficult on iOS because third-party frameworksare not officially supported. ObjectiveGit offers a static library instead. An exampleof this is the ObjectiveGit iOS Exampleon GitHub. In summary: - Drag
ObjectiveGitFramework.xcodeproj into the Project Navigator. - Add
ObjectiveGit-iOS as a target dependency of your application. - Link your application to
libObjectiveGit-iOS.a , libz.dylib , and libiconv.dylib . - In your target's build settings:
- Set "Always Search User Paths" to
YES - Add
$(BUILT_PRODUCTS_DIR)/usr/local/include andPATH/TO/OBJECTIVE-GIT/External/libgit2/include to the "User HeaderSearch Paths" - Add
-all_load to the "Other Linker Flags"
ContributingFork the repository on GitHub, make it awesomer (preferably in a branch namedfor the topic), send a pull request. All contributions should match GitHub's Objective-C codingconventions. You can see all the amazing people that have contributed to this projecthere. LicenseObjectiveGit is released under the MIT license. Seethe LICENSE file. |
请发表评论