[关闭]
@xifenglang-33250 2019-01-08T16:46:00.000000Z 字数 749 阅读 697

创建公开CocoaPods组件库

组件开发笔记


1. 在GitHub已有项目上添加开源协议文件

点击Create new file,输入LICENSE,选择MIT协议模板

2. 克隆AA.git到本地

3. 创建AA.podspec文件

pod spec create AA 指令或者 JKPod_create_spec AA

下面是比较通用的模板

  1. Pod::Spec.new do |s|
  2. s.name = "JKAlertManager"
  3. s.version = "1.2.0"
  4. s.summary = "深度封装UIAlertController,良好兼容UIAlertControllerStyleAlert和UIAlertControllerStyleActionSheet"
  5. s.homepage = "https://github.com/XiFengLang/JKAlertManager"
  6. s.license = "MIT"
  7. s.author = { "XiFengLang" => "lang131jp@vip.qq.com" }
  8. s.source = { :git => "https://github.com/XiFengLang/JKAlertManager.git", :tag => "#{s.version}" }
  9. s.platform = :ios,"8.0"
  10. s.framework = "UIKit"
  11. s.requires_arc = true
  12. s.source_files = "src/*.{h,m}"
  13. end
  14. ``
  15. ###4.编译验证
  16. > `pod lib lint`或者`jkPod_lib_lint`
  17. ###5.Git打标签并提交
  18. ```C
  19. 创建标签
  20. $ git tag -a 1.0.0 -m '标签说明'
  21. 推送到远程
  22. $ git push origin --tags

最后发布

pod trunk push AA.podspec

参考

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注