swift上传自己的代码到CocoaPods
2019-08-07 本文已影响0人
好快的刀
1.首先要在github上新建仓库

2.把仓库克隆到本地
2.1在桌面新建一个文件夹,名字随意。我这里就取跟仓库一样的名字吧

2.2使用终端命令

git clone https://github.com/luoshiqing/MyTestPods.git 空文件位置
2.3完了可以看到文件里边是这样的


2.4使用命令生成.podspec文件 cd到桌面文件夹(MyTestPods)
pod spec create MyTestPods
这时,当前目录会多出一个文件MyTestPods.podspec

2.5编辑MyTestPods.podspec,可以使用系统 文本编辑 打开

name与github仓库名称一致,version为仓库标签(待会会说到打标签) author需要去注册 trunk,homepage为仓库网页地址,source为git地址,swift_versions为swift语音版本,source_files 为目标文件地址,这里填写跟 MyTestPods.podspec同级的。