美文网首页
搭建Cocoapods私有仓库

搭建Cocoapods私有仓库

作者: LeafRead | 来源:发表于2016-08-11 16:58 被阅读62次

    搭建流程

    以PAWFBannerView为例

    地址: http://git-ma.paic.com.cn/PAWiFi_iOS/PAWFBannerView.git

    在公司的gitlab上创建一个私有仓库

    git可以使用sourcetree客户端, 是一款免费软件, 相当于SVN的Cornerstone

    地址: http://git-ma.paic.com.cn/

    创建仓库 pod repo add NAME URL [BRANCH]

    pod repo add PrivateRepo http://git-ma.paic.com.cn/PAWFSpecRepo/PrivateRepo.git

    检查仓库 pod repo lint [NAME|DIRECTORY]

    pod repo lint .cocoapods/repos/PrivateRepo

    创建.podspec文件 pod spec create [NAME|https://github.com/USER/REPO]

    pod spec create PAWFBannerView

    检查.podspec文件 pod spec lint [NAME.podspec|DIRECTORY|http://PATH/NAME.podspec …]

    pod lib lint

    pod lib lint --verbose

    pod lib lint --allow-warnings #忽略警告

    提交到私有仓库 pod repo push REPO [NAME.podspec]

    pod repo push PrivateRepo PAWFBannerView.podspec

    pod repo push PrivateRepo PAWFBannerView.podspec --allow-warnings

    更新仓库 pod repo update [NAME]

    pod repo update ~/.cocoapods/repos/PrivateRepo

    使用方法

    直接指定源地址

    pod 'PAWFBannerView', :git => 'http://git-ma.paic.com.cn/PAWiFi_iOS/PAWFBannerView.git'

    直接指定本地路径

    pod 'PAWFBannerView', :PATH => '~/Documents/Github/PAWFBannerView'

    指定podspec文件

    pod 'PAWFBannerView', :podspec =>'~/Documents/Github/PAWFBannerView/PAWFBannerView.podspec'

    常规方法

    pod 'PAWFBannerView' #使用最新版本

    pod 'PAWFBannerView', '~> 0.1' #指定版本>=0.1且<0.2

    pod 'PAWFBannerView', '0.1' #指定版本0.1

    其他

    -> 0.1 Any version higher than 0.1.

    ->= 0.1 Version 0.1 and any higher version.

    -< 0.1 Any version lower than 0.1.

    -<= 0.1 Version 0.1 and any lower version.

    相关资料

    使用Cocoapods创建私有podspec

    CocoaPods创建私有Pods

    Cocoapods官方文档

    git教程

    作者: 平安-李新星

    相关文章

      网友评论

          本文标题:搭建Cocoapods私有仓库

          本文链接:https://www.haomeiwen.com/subject/errssttx.html