创建podsepc

来源:互联网 发布:对焦算法 编辑:程序博客网 时间:2024/06/03 10:16

1.git添加tag
2.保持spec.podspec 中tag一致,提交修改代码
3.检测本地spec.podspec是否正确 允许警告 详细展示
pod spec lint CNMLib –allow-warnings –verbose
4.推送到远端
pod trunk push CNMLib.podspec –verbose –allow-warnings
5.pod setup
6.pod search CNMLib
其中我的远端路径为/CocoaPods/Specs/bb53570ed3252a81fd9bc9586c6297b7fe5e83d0/Specs/5/c/9/CNMLib
fork https://github.com/CocoaPods/Specs 到本地后查看
以后需要上传到Specs审核,貌似现在不需要了,推送到远端稍等会就会出来

步骤
1.修改代码后上传
2.打tag ,跟上传的tag保持一致
3.pod trunk push CNMLib.podspec –verbose –allow-warnings 跳过警告提交

CNMLib git传送门

我的podspec文件

## Be sure to run `pod lib lint CNMLib.podspec' to ensure this is a# valid spec before submitting.Pod::Spec.new do |s|s.name             = 'CNMLib's.version          = '0.5.0's.summary          = 'A short description of CNMLib.'# This description is used to generate tags and improve search results.#   * Think: What does it do? Why did you write it? What is the focus?#   * Try to keep it short, snappy and to the point.#   * Write the description between the DESC delimiters below.#   * Finally, don't worry about the indent, CocoaPods strips it!s.description      = <<-DESCTODO: Add long description of the pod here.DESCs.homepage         = 'https://github.com/xiamoweinuan/CNMLib's.license          = { :type => 'MIT', :file => 'LICENSE' }s.author           = { 'xiamoweinuan' => 'gaoshuangone@qq.com' }s.source           = { :git => 'https://github.com/xiamoweinuan/CNMLib.git', :tag => s.version.to_s }# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'s.ios.deployment_target = '7.0's.source_files = 'CNMLib/Classes/**/*.{h,m}'# s.resource_bundles = {#   'CNMLib' => ['CNMLib/Assets/*.png']# }# s.public_header_files = 'Pod/Classes/**/*.h'# s.frameworks = 'UIKit', 'MapKit'# s.dependency 'AFNetworking', '~> 2.3'end

如果本地和git上文件都对,执行pod spec lint CNMLib –allow-warnings –verbose的时候一直报文件错误,进入文件路径 /Users/gaoshuang/Library/Caches/CocoaPods/Pods/External/CNMLib/ee2fc8a80215953a3773aa92c682d000-44921替换掉错误文件(入相应文件夹,创建文件夹与[source_files文件路径对应])

其它资源
1.http://blog.csdn.net/wzzvictory/article/details/20067595
2.http://www.cocoachina.com/ios/20150228/11206.html
3.http://blog.csdn.net/keleyundou/article/details/49635589