iOS开发技巧

创建自己的cocoapods库

2018-04-19  本文已影响6人  天空像天空一样蓝

最近在整理自己的简历,发现简历上面没有拿的出手的干货,都是一些“负责什么界面、维护什么迭代”,全是业务、业务、业务。
创建cocoapods库过程中全程自己摸索,很苦逼,很蛋疼
创建空文件 用于承载pod给你创建好的工程

然后提示你会让你回答几个问题,注意大小字母和空格的问题

此时已经进行到一半了,进入我们熟悉的Xcode中


Snip20180419_18.png

输入下面的代码,验证我们的配置文件有没有错误,很坑很坑很坑很坑

➜  GCYBase git:(master) pod lib lint GCYBase.podspec 

 -> GCYBase (0.1.0)

GCYBase passed validation.
Snip20180419_19.png
git add . 
git commit -m “Initial Commit" 
git remote add origin https://github.com/xxx/xxx.git 
git push -u origin master
➜  GCYBase git:(master) ✗ pod spec lint GCYBase.podspec

 -> GCYBase (0.1.2)

Analyzed 1 podspec.

GCYBase.podspec passed validation.

➜  GCYBase git:(master) ✗ pod trunk push GCYBase.podspec 
Updating spec repo `master`
[!] CocoaPods was not able to update the `master` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`
➜  GCYBase git:(master) 

根据提示运行

➜  GCYBase git:(master) pod repo update --verbose

等待pod更新完成


Snip20180419_21.png

重新运行 pod trunk push GCYBase.podspec 总于等到你

➜  GCYBase git:(master) ✗ pod trunk push GCYBase.podspec
Updating spec repo `master`

CocoaPods 1.5.0 is available.
To update use: `sudo gem install cocoapods`

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.5.0

Validating podspec
 -> GCYBase (0.1.2)

Updating spec repo `master`

CocoaPods 1.5.0 is available.
To update use: `sudo gem install cocoapods`

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.5.0


--------------------------------------------------------------------------------
 🎉  Congrats

 🚀  GCYBase (0.1.2) successfully published
 📅  April 19th, 03:50
 🌎  https://cocoapods.org/pods/GCYBase
 👍  Tell your friends!
--------------------------------------------------------------------------------
➜  GCYBase git:(master) ✗ 

然后就是默默的等待吧,大概两个工作日
可以通过 search xxx 查找自己的pod

上一篇 下一篇

猜你喜欢

热点阅读