使用Cocoapods创建私有podspec

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... // 搜索库,能搜到就可以导入库到项目中了



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值