为了账号安全,请及时绑定邮箱和手机立即绑定

CocoaPods 创建私有仓库注意事项

标签:
iOS

以前总结过,最近要使用组件化,但是遇见问题再看以前的手记,却发现行不通了,感觉又得重新整理,技术变化太快,总要紧跟技术潮流。再来一遍吧。
$ pod repo 查看本地索引库

在https://coding.net上创建
私有仓库Spec https://git.coding.net/ZKReadStone/ZKNewSpec.git
和私有项目仓库Module https://git.coding.net/ZKReadStone/BaseXib.git

$ pod lib create BaseXibView 创建私有库工程 最好再指定位置创建,例桌面的CocoaLib文件夹里

$ pod repo add ZKSpec https://git.coding.net/ZKReadStone/ZKNewSpec.git
添加本地私有索引库并与远程私有库关联

私有库文件替换Replace.m文件

修改.podspec文件,重点–重点–重点


Pod::Spec.new do |s|
  s.name             = 'XibView'
  s.version          = '0.1.0'
  s.summary          = 'use of XibView.'

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!

  s.description      = <<-DESC
XibView is xib a tool for user ,any can product a project quickly!!!!
                        DESC  #模块详情描述,比 s.summary 长点

  s.homepage         = 'https://coding.net/u/ZKReadStone/p/ZKNewSpec' #Spec主页
  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'ZKReadStone' => 'zhangkangreadstone@163.com' }#账户名和邮箱,这里也要正确,如果在https://coding.net ,账户名  和对应的邮箱
  s.source           = { :git => 'https://git.coding.net/ZKReadStone/BaseXib.git', :tag => s.version.to_s }#模块资源地址 注意不是Spec地址
  # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

  s.ios.deployment_target = '9.0'  #模块支持的版本

  s.source_files = 'XibView/Classes/*.{h,m}'#表示资源文件位置类型
  
  # s.resource_bundles = {
  #   'XibView' => ['XibView/Assets/*.png']
  # }

  # s.public_header_files = 'Pod/Classes/**/*.h'
  # s.frameworks = 'UIKit', 'MapKit'
  # s.dependency 'AFNetworking', '~> 2.3'
end

上传到远程仓库
cd 到对应的目录下
$ git remote add origin https://…git//关联远程仓库

$ git status //查看提交文件状态

$ git add .

$ git commit -m"first commits"

$ git push origin master

$ git tag ‘0.1.0’

$ git push --tags //打tag 重点–重点–重点 必要步骤

cd Example 下 $ pod install

验证本地和远端

$ pod lin lint

$ pod spec lint

$ pod spec lint --allow-warnings(验证远程是否正确,注意:Username与Password一定要填写正确)

$ pod repo push ZKSpec ZKNewSpec.podspec

$ pod repo

使用

source 'https://git.coding.net/ZKReadStone/ZKNewSpec.git'

platform :ios, '9.0'

target 'TestDemo' do

use_frameworks!

pod 'XibView'

end
点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
移动开发工程师
手记
粉丝
32
获赞与收藏
322

关注作者,订阅最新文章

阅读免费教程

  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消