0

我正在尝试将objective-git 包含在ruby 运动中。我尽力将目标 gits 站点上的要求转换为 OS X ruby​​ 运动应用程序所需的内容。这是 Rakefile,objective-git 是位于 vendor 中的子模块。

# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/osx'

require 'bundler/setup'
Bundler.require :default

Motion::Project::App.setup do |app|
  app.name = 'commit-zero'
  app.vendor_project 'vendor/objective-git', :xcode,
                     xcodeproj: 'vendor/objective-git/ObjectiveGitFramework.xcodeproj',
                     headers_dir: 'vendor/objective-git/External/libgit2/include'
end

这是错误:

$ rake
     Build ./build/MacOSX-10.10-Development
Received exception: No headers to parse:
/usr/bin/gen_bridge_metadata:980:in `prepare'
/usr/bin/gen_bridge_metadata:776:in `parse'
/Library/RubyMotion/bin/gen_bridge_metadata:118:in `block in <main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/optparse.rb:885:in `initialize'
/Library/RubyMotion/bin/gen_bridge_metadata:38:in `new'
/Library/RubyMotion/bin/gen_bridge_metadata:38:in `<main>'
No headers to parse
Usage: gen_bridge_metadata [options] <headers...>
Use the `-h' flag or consult gen_bridge_metadata(1) for help.
rake aborted!
Command failed with status (1): [RUBYOPT='' '/Library/RubyMotion/bin/gen_br...]
/Library/RubyMotion/lib/motion/project/xcode_config.rb:366:in `gen_bridge_metadata'
/Library/RubyMotion/lib/motion/project/vendor.rb:221:in `block in build_xcode'
/Library/RubyMotion/lib/motion/project/vendor.rb:153:in `chdir'
/Library/RubyMotion/lib/motion/project/vendor.rb:153:in `build_xcode'
/Library/RubyMotion/lib/motion/project/vendor.rb:44:in `build'
/Library/RubyMotion/lib/motion/project/builder.rb:67:in `block in build'
/Library/RubyMotion/lib/motion/project/builder.rb:66:in `each'
/Library/RubyMotion/lib/motion/project/builder.rb:66:in `build'
/Library/RubyMotion/lib/motion/project/app.rb:78:in `build'
/Library/RubyMotion/lib/motion/project/template/osx.rb:41:in `block (2 levels) in <top (required)>'
/Library/RubyMotion/lib/motion/project/template/osx.rb:59:in `block in <top (required)>'
Tasks: TOP => build:development
(See full trace by running task with --trace)
4

2 回答 2

1

创建 ObjectiveGit.framework

$ brew install cmake xctool
$ git clone https://github.com/libgit2/objective-git.git && cd objective-git
$ script/bootstrap
$ xcodebuild

ObjectiveGit.framework将在build/Release.

设置应用程序

$ motion create TestGit --template=osx && cd TestGit
$ rsync -av path/to/build/Release/ObjectiveGit.framework vendor

并将以下配置添加到Rakefile.

app.embedded_frameworks << 'vendor/ObjectiveGit.framework'
于 2014-08-05T06:27:52.593 回答
0

RubyMotion 在从 Objective-C/C 头文件生成元数据时使用 Apple 提供的 gen_bridge_metadata 命令,以便正确调用来自 Ruby 的 API。

不幸的是, gen_bridge_metadata 目前还不支持 C++ 标头。您将需要从“app.vendor_project”中删除 C++ 头目录路径。

于 2014-08-02T04:48:24.913 回答