前言
*终端执行
pod repo list

-
1建立自己的私有Spec.git
假如以码云为例:https://gitee.com/mlionnner/LionnnerSpec.git

-
2将建立的私有Spec.git添加到本地
pod repo add NAME URL [BRANCH]
Eg: pod repo add MSpec https://gitee.com/mlionnner/LionnnerSpec.git
再次执行
pod repo list

-
3新建另外的一个仓库并上传自己的代码
例如: https://gitee.com/mlionnner/MLView.git

假如我想上传 MLView文件内的所有代码文件

-
4创建 podspec文件
进入到本地仓库的根目录
cd /Users/lvjialin/lionnner/MLView

pod spec create [NAME|https://github.com/USER/REPO]
Eg: pod spec create MLView
生成了如下的文件

-
5编辑podspec文件
spec.homepage = "https://gitee.com/mlionnner/MLView"
spec.license = "MIT"
spec.platform = :ios, "8.0"
spec.source = { :git => "https://gitee.com/mlionnner/MLView.git", :tag => "#{spec.version}" }
spec.source_files = "MLView/**/MLView/*.{h,m}"
#spec.exclude_files = "Classes/Exclude"

修改后

-
6上传
将MLView的仓库打上tag 0.0.1
终端执行
pod lib lint

pod repo push MSpec MLView.podspec --allow-warnings
网友评论