一、创建自己的github 仓库。
Repository name : 项目名。
Description ?:项目的说明描述。
选Public 可以共享。。。。公司选 Private 收费的。
包含 Initialize this repository with a README
Add .gitignore: ?Object-C ? ? ? ? ??
Add a License: MIT?
二:
git clone ?https://github.com/sddd…….git
三:编写 pod spec 文件。
Pod::Spec.new do |s|
s.name ? ? ? ? ? ? = “项目名"
s.version ? ? ? ? ?= "1.1.0"
s.summary ? ? ? ? ?= “iOS各种,,,描述。。。。"
s.description ? ? ?= <<-DESC
?"常用的iOS类目整描述。。。理"
DESC
s.homepage ? ? ? ? = "https://github.com/xiaoming/JSONKIT"
s.license ? ? ? ? ?= ‘MIT‘
s.author ? ? ? ? ? = { “小明" => “zjjsdf@163.com" }
s.source ? ? ? ? ? = { :git => "https://github.com/xiaoming/JSONKIT
?", :tag => s.version.to_s }
s.platform ? ? = :ios, ‘7.0‘
s.requires_arc = true
s.source_files = ’XXX/*‘
s.frameworks = ‘Foundation‘, ‘CoreGraphics‘, ‘UIKit‘
end
写完后。
?pod lib lint ? //验证下有没有错误。。。。
四:自己的 项目文件夹包含:ReadMe ? ? podspec ? ?代码的文件 ? ? ?LICENSE ? ?四个文件。
五:git add . ? ?
git commit -m “sdasddf”
git tag “1.0.0”
git push —tags
git push origin master?
?
?
六。pod trunk register ?sdsdsd@163.com ? ?“小明” ? ? ??
这里的邮箱 ?,用户名 ?和 ? s.author ? 的 ?要保持一致。。。。
?
pod trunk ?me ? ?///查看自己的注册的信息。。。刚才的需要去邮箱里激活。
?
当然,如果你的pod是由多人维护的,你也可以添加其他维护者
pod trunk add-owner ARAnalytics kyle@cocoapods.org
七: pod trunk push
八。pod search sdfsdf
搜索到。说明 成功了。。。
九:另外,如果想要搜索到新人传的pod ,,,需要更新下自己本地的pod …
pod setup
?
?
十:更新的时候,,,commit ?,push 代码,,,tag ,,,并且把 spec里面的tag 修改好就可以了。。。
podspec 发布自己的pods到CocoaPods trunk
原文:http://zhangmingwei.iteye.com/blog/2254936