1. github 上边创建工程
2. pod lib create podTestLibrary
3. 在podTestLibrary 下边的Classes 把写好的文件copy进去
4. 打开Example 工程,进行编译发现少pod依赖。
5. 在 podTestLibrary.podspec 最后增加我自己程序的pod依赖
s.dependency 'CocoaLumberjack'
6. 重新编译工程,成功。
7. pod lib lint 进行验证
- WARN | xcodebuild: /Users/yangziminyangzimin/ALSLog/ALSLog/Classes/ALSLog.m:130:47: warning: assigning to 'id<DDLogFormatter> _Nonnull' from incompatible type 'MyCustomFormatter *'
- WARN | xcodebuild: /Users/yangziminyangzimin/ALSLog/ALSLog/Classes/ALSLog.m:157:39: warning: assigning to 'id<DDLogFormatter> _Nonnull' from incompatible type 'MyCustomFormatter *'
- WARN | xcodebuild: /Users/yangziminyangzimin/ALSLog/ALSLog/Classes/ALSLogConfig.m:59:33: warning: assigning to 'id<DDLogFormatter> _Nonnull' from incompatible type 'MyCustomFormatter *__strong'
[!] ALSLog did not pass validation, due to 3 warnings (but you can use `--allow-warnings` to ignore them).
[!] The validator for Swift projects uses Swift 3.0 by default, if you are using a different version of swift you can use a `.swift-version` file to set the version for your Pod. For example to use Swift 2.3, run:
`echo "2.3" > .swift-version`.
You can use the `--no-clean` option to inspect any issue.
8. 说明是有一些warning 要用: pod lib lint --allow-warnings --use-libraries
显示:podTestLibrary passed validation. 本地验证成功
9. 加入source tree 上传
10. 用source tree 增加一个tag 工具栏上边右击-》自定义工具栏 把tag 拖放出来。
11. 点一下在里边加入一个tag 写入版本号0.0.1
12. 修改podTestLibrary.podspec 文件
(1). s.summary = 'ios log'
(2).
s.description = <<-DESC
写入一些文字,否则不能上传
DESC
13. pod trunk register yangzmpang@sina.com "yangzm"
第一次用时到邮件箱收取,激活。
14. pod trunk me
15. pod spec lint --allow-warnings --use-libraries 网络检查,是否成功。
16. pod trunk push podTestLibrary.podspec --allow-warnings --use-libraries
如果成功,就可以查询到结果了。
如果没数据就把:
1.pod repo update // 更新pods本地仓库
2.rm ~/Library/Caches/CocoaPods/search_index.json // 删除搜索索引文件
3.pod search name... // 搜索库,能搜到就可以导入库到项目中了