关于私有pod库依赖私有库

5,122 阅读1分钟

问题描述:比如打算制作私有库Lib1,但是它依赖另一个私有库Lib2.应该怎样制作Lib1的pod?

  1. Lib1的podspec文件里面的依赖为:
    s.dependency 'Lib2'
  2. 如果要运行Lib1的example中的项目,需要在podfile添加Lib2的仓库repo2
    source 'https://github.com/CocoaPods/Specs.git'
    source 'repo2的url'
    
    然后执行pod install
  3. 推送Lib1的podspec到仓库repo1,主要是命令添加sources参数,执行:
    pod repo push private_repo --sources=https://github.com/CocoaPods/Specs.git,repo1的url --allow-warnings