亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

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' => '[email protected]' }#账户名和邮箱,这里也要正确,如果在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
獲贊與收藏
323

關注作者,訂閱最新文章

閱讀免費教程

  • 推薦
  • 評論
  • 收藏
  • 共同學習,寫下你的評論
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學

大額優惠券免費領

立即參與 放棄機會
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號

舉報

0/150
提交
取消