I think it would be cool to use TouchDB with RubyMotion, particularly the synchronization possibilities.
Unfortunately, I have not been able to get the TouchDB CocoaPod to build with motion-cocoapods.
I created a test project:
motion create TouchTest
My Gemfile:
My Rakefile:
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
require 'bundler'
Bundler.require
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.pods do
pod 'TouchDB', '~> 0.961'
end
end
I get a bunch of errors related to release not being available in reference counting mode:
/Users/jimbo/projects/ruby-motion/TouchTest/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m:118:3: error: 'release' is unavailable: not available in automatic reference counting mode
dispatch_release(saveTimer);
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/usr/include/dispatch/object.h:183:35: note: expanded from macro 'dispatch_release'
_dispatch_object_validate(_o); [_o release]; })
^
(several more similar errors)
I also get errors because dispatch_get_current_queue() is deprecated:
/Users/jimbo/projects/ruby-motion/TouchTest/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m:206:6: warning: 'dispatch_get_current_queue' is deprecated: first deprecated in iOS 6.0 [-Wdeprecated-declarations]
if (dispatch_get_current_queue() == loggerQueue)
^
Setting deployment_target to 5.1:
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.deployment_target = "5.1"
app.pods do
pod 'TouchDB', '~> 0.961'
end
end
gives me different errors:
duplicate symbol _OBJC_IVAR_$_TDReachability._hostName in:
/Users/jimbo/projects/ruby-motion/TouchTest/vendor/Pods/build-iPhoneSimulator/libPods.a(TDReachability.o)
/Users/jimbo/projects/ruby-motion/TouchTest/vendor/Pods/build-iPhoneSimulator/libPods.a(TDReachability_Stubs.o)
From the little bit of research I did, I'm pretty sure in this case the _Stubs version is meant for the GNUStep implementation, and motion-cocoapods is missing whatever cues there are in the CocoaPod to ignore this file.
Interestingly, if I open vendor/Pods/Pods.xcodeproj in XCode, I can build the "iPhone 6.0 Simulator" target without incident. This is why I think the issue is not with the TouchDB CocoaPod, but with how it's interpreted by motion-cocoapods.
Ideas about what else I can try? Do you think this is salvageable, or have I slipped off the bleeding edge here? (TouchDB about to go 1.0, RubyMotion, and motion-cocoapods all still in flux and very new, so not surprising there are issues.)
Is there any way to better control what files are compiled by motion-cocoapods? Should I report this as an issue on motion-cocoapods?
Anyone else interested in using TouchDB with RubyMotion?
Thanks in advance,
-jim rankin