Cocoapods-binary-cache 批量打包静态库接入步骤

安装步骤

  • gem init 在Project同级的目录生成一个Gem文件,填写以下信息
    gem 'cocoapods', '1.10.0'
    gem "cocoapods-binary-cache", :git => "https://github.com/grab/cocoapods-binary-cache.git", :tag => "0.1.13"

  • 执行bundle install

  • 下载插件 gem install cocoapods-binary-cache

  • podfile里面配置

    plugin "cocoapods-binary-cache"

   cache_repo: {
    "default" => {
      "remote" => "https://git.XXX/BSTeam/libcache2",
      "local" => "~/.cocoapods-binary-cache/prebuilt-frameworks1"
    },
     "test" => {
#                              "remote" => "https://git.XXX.com/BSTeam/libcache2",
                              "local" => "~/.cocoapods-binary-cache/prebuilt-frameworks1"
     }
  },
  prebuild_config: "Debug",
  dev_pods_enabled: true
)

  • 执行bundle exec pod binary prebuild —config=test

  • 创建lib本地包的git及与远端git做关联

  • 执行push推送到远端 bundle exec pod binary push

  • bundle exec pod install 装载

本地路径在Rebuild后需要自己手动配置git及关联远程的git

参考文档
Cocoapods-binary: https://github.com/leavez/cocoapods-binary
Cocoapods-binary-cache : https://github.com/grab/cocoapods-binary-cache
CocoaPods-imy-bin:https://github.com/MeetYouDevs/cocoaPods-imy-bin

打包方式

  • Build
    bundle exec pod binary prebuild
  • Push
    bundle exec pod binary push
  • Fetch
    bundle exec pod binary fetch

远端存在的话只需要执行

$ bundle exec pod binary fetch
$ bundle exec pod install

你可能感兴趣的:(Cocoapods-binary-cache 批量打包静态库接入步骤)