先在GitHub上创建一个公共的项目:

将项目clone到本地
git clone https://github.com/hwqforapple/WQShareLiboc.git
在项目目录里面创建.podspes 文件以及demo项目
pod lib create WQShareLiboc
项目创建成功后,Xcode会自动打开项目

然后编辑podspec文件

在存放源文件的目录中添加代码文件,新建成功的项目中会存在一个Replaceme文件,可以删除

然后可在demo项目中引用库文件,编写测试代码

代码测试成功后,我们先使用pod lib lint WQShareLiboc.podspec
进行验证库的可使用性。如果出现warn而不能通过可以在命令后面拼接--allow-warnings
忽略掉这些警告

验证通过后,提交代码到git仓库,
添加tag git tag 0.0.2
推送tag到服务器 git push origin --tags
最后提交pod到GitHub上去
pod trunk push pod_test.podspec
网友评论