CocoaPod Library + Project in one workspace, Separately GIT Repo

I am trying to wrap my head around this complicated setup:

I have two projects and a shared library. The shared library is cocoapod.

I would like to be able to use one workspace for development. There are several duplicate container definitions, but it works for me in one subfile.

Here, where it gets complicated:

I want each project / library to be located in its git repository. Each repo should be able to live independently; have your own subfile, test / deploy through CI, etc.

Another key: we are git -flow forking strategy ... The main branch of the A / B project is to pull out the main branch of the library. The developed branch of the A / B project should bring the library development branch.

Has anyone figured this out? Am I going about this in the back way?

Here is the working submenu of the working working root:

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 generic podspec library:

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
+4
source share
1 answer

, , "" CocoaPod. Podfile. , , , Xcode. CocoaPod , podspec. , . ,

source 'https://github.com/CocoaPods/Specs.git'

target 'SharedLibrary', :exclusive => true do
  xcodeproj 'SharedLibrary/SharedLibrary.xcodeproj'
end

pod 'SharedLibrary', :path => 'SharedLibrary/'

, . , , , pod update, .

0

Source: https://habr.com/ru/post/1543276/


All Articles