RubyMotion 提供了以下有关供应商第三方代码的说明: http://www.rubymotion.com/developer-center/guides/project-management/#_files_dependencies
我正在尝试添加Parse.com的iOS SDK。以下是将其添加到 XCode 项目的说明:https://parse.com/apps/quickstart#ios/existing。但是,我没有使用XCode,因为我正在使用RubyMotion。
我在这里记录了我的尝试:https://github.com/adelevie/RubyMotionSamples/commit/603bf4428995bb203cce7e7e8e6989d6e86bda3b
这是我得到的错误:https://gist.github.com/2595284
我们实际上在这里处理了一个静态库,所以我认为你应该指定 :static 而不是 :Xcode 作为第二个选项。
使用Rakefile中的以下代码,应用程序将编译:
app.libs << '/usr/lib/libz.1.1.3.dylib'
app.frameworks += [
'AudioToolbox',
'CFNetwork',
'SystemConfiguration',
'MobileCoreServices',
'Security',
'QuartzCore']
app.vendor_project('vendor/Parse.framework', :static,
:products => ['Parse'],
:headers_dir => 'Heiders')
但是,我在运行解析集应用程序 ID 方法时收到以下错误:
(main)>> Objective-C stub for message `setApplicationId:clientKey:' type `v@:@@' not precompiled. Make sure you properly link with the framework or library that defines this message.
链接的文档说:"要在 RubyMotion 项目中提供第三方库,源代码必须在文件系统的某个位置可用。 所以我不认为将 .framework 文件放在那里会起作用。
您可以尝试从 parse.com/docs 下载名为"Blank Xcode w/SDK"的ParseStartProject。 如果您提供该项目文件夹,RubyMotion 将能够找到它正在寻找的 xcode 项目。 当然,您需要从 xcode 项目中删除 .m 和 .h 文件,因为您只希望项目包含 Parse.framework。
我实际上还没有尝试过这个。 如果您让它正常工作,请告诉我们。
RubyMotion小组的一个答案中复制了这个答案。它似乎修复了存根错误消息:
现在,为了完成这项工作,我修改了/Library/RubyMotion/lib/motion/project/vendor.rb,并将第 38 行的 Dir.glob 从:
source_files = (opts.delete(:source_files) or Dir.glob('*.
{c,m,cpp,cxx,mm,h}'))
自:
source_files = (opts.delete(:source_files) or Dir.glob('**/*.
{c,m,cpp,cxx,mm,h}'))
http://groups.google.com/group/rubymotion/msg/0efa74214523d0f5