• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

objective-git: Objective-C bindings to libgit2

原作者: [db:作者] 来自: Gitee 收藏 邀请

ObjectiveGit

Carthage compatibleBuild Status

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 Started

To 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 X

It is simple enough to add the ObjectiveGit framework to a desktop applicationproject. An example of this is theCommitViewer example on GitHub. In summary:

  1. Drag the ObjectiveGitFramework.xcodeproj file into the project navigator.
  2. Add the ObjectiveGit framework as a target dependency of your application.
  3. Link your application with ObjectiveGit.framework.
  4. 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.
  5. 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.
  6. Don't forget to #import <ObjectiveGit/ObjectiveGit.h> as you would with anyother framework.

Importing ObjectiveGit on iOS

Getting 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:

  1. Drag ObjectiveGitFramework.xcodeproj into the Project Navigator.
  2. Add ObjectiveGit-iOS as a target dependency of your application.
  3. Link your application to libObjectiveGit-iOS.a, libz.dylib, and libiconv.dylib.
  4. In your target's build settings:
    1. Set "Always Search User Paths" to YES
    2. Add $(BUILT_PRODUCTS_DIR)/usr/local/include andPATH/TO/OBJECTIVE-GIT/External/libgit2/include to the "User HeaderSearch Paths"
    3. Add -all_load to the "Other Linker Flags"

Contributing

Fork 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.

License

ObjectiveGit is released under the MIT license. Seethe LICENSE file.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap