I'm trying to wrap my head around this complex setting:
I have two projects and a shared library. The shared library is a cocoapod.
I would like to be able to use a single workspace to develop in. There are some duplicated pod definitions, but I have this working in a single Podfile.
Here's where it gets complicated:
I want each project/library in its own git repo. Each repo must be able to live on its own; have its own Podfile, be tested/deployed via CI, etc.
Another wrench: we are the git-flow branching strategy... The master branch of project A/B must pull the master branch of the library. The develop branch of project A/B must pull the develop branch of the library.
Has anyone figured this out? Am I going about this in an ass-backwards way?
Here is a working root workspace Podfile:
platform :ios, "7.0"
inhibit_all_warnings!
workspace 'Root.xcworkspace'
xcodeproj 'SharedLibrary/SharedLibrary.xcodeproj'
xcodeproj 'ProjectA/ProjectA.xcodeproj'
xcodeproj 'ProjectB/ProjectB.xcodeproj'
target 'SharedLibrary' do
xcodeproj 'SharedLibrary/SharedLibrary.xcodeproj'
pod 'AFNetworking', '~> 2.0'
pod 'CocoaLumberjack'
end
target 'ProjectA' do
xcodeproj 'ProjectA/ProjectA.xcodeproj'
pod 'AFNetworking', '~> 2.0'
pod 'CocoaLumberjack'
pod 'MagicalRecord', '~> 2.2'
pod 'SharedLibrary', :path => './SharedLibrary/'
end
target 'ProjectB' do
xcodeproj 'ProjectB/ProjectB.xcodeproj'
pod 'AFNetworking', '~> 2.0'
pod 'CocoaLumberjack'
pod 'MagicalRecord', '~> 2.2'
pod 'SharedLibrary', :path => './SharedLibrary/'
end
Here is the shared library's podspec:
Pod::Spec.new do |s|
s.name = "SharedLibrary"
s.version = "0.0.1"
s.platform = :ios, "7.0"
s.source = { :git => "http://not.really.uploaded.anywhere.yet/SharedLibrary.git", :tag => "0.0.1" }
s.source_files = "SharedLibrary", "SharedLibrary/**/*.{h,m}"
s.public_header_files = "SharedLibrary/**/*.h"
s.dependency 'AFNetworking', '~> 2.0'
s.dependency 'CocoaLumberjack'
end