Skip to content

Instantly share code, notes, and snippets.

@klone1127
Last active January 21, 2019 10:05
Show Gist options
  • Select an option

  • Save klone1127/de85e0a1612e3fd2d0627c68b68912f5 to your computer and use it in GitHub Desktop.

Select an option

Save klone1127/de85e0a1612e3fd2d0627c68b68912f5 to your computer and use it in GitHub Desktop.
创建私有库(pods)
@klone1127
Copy link
Copy Markdown
Author

klone1127 commented Dec 14, 2018

创建私有仓库

1

pod lib create Demo

2

创建仓库(其实是为了把1中生成的文件复制进去)

3

更改Demo.podspec 文件,仓库地址是2的地址

4

pod lib lint Demo.podspec 校验配置是否有错

如果是依赖私有仓库,会出现错误

 -> JSContainer (0.0.3)
    - ERROR | [iOS] unknown: Encountered an unknown error (Unable to find a specification for `KPopMenu` depended upon by `JSContainer`) during validation.

解决办法就是指定Spec地址

pod lib lint 文件名.podspec --sources='http://[privateLibName]/cocoaspecs.git,https://github.com/CocoaPods/Specs.git'
5

提交2代码更改到服务器,并添加tag(要和Demo.podspec中版本号一致)

6

创建 Specs 仓库(如果已有的话忽略此步骤)
pod repo add DemoSpecs xxx/DemoSpecs.git

7

推送到服务器端 DemoSpecs
pod repo push DemoSpecs Demo.podspec`

使用的时候要加上 source 'xxx/DemoSpecs.git' 源地址

后期维护的时候只需要更改源代码,校验配置文件,提交到服务器就行
也就是 更改代码 -> pod lib lint Demo.podspec -> pod repo push DemoSpecs Demo.podspec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment