美文网首页
私有pod制作

私有pod制作

作者: 陈贤森 | 来源:发表于2021-06-10 16:23 被阅读0次

两个仓库

1.代码仓库 code repository

这个仓库是用来存放代码的,正常提交就可以,流程:
1 创建pod项目建议使用pod提供的模板:

pod lib create youNameBase

成功之后会生成项目结构:


WX20210604-181732.png

编辑podSpec文件:

Pod::Spec.new do |s|
  s.name             = 'Library'
  s.version          = '0.1.5'
  s.summary          = 'Library'
  s.description      = 'Library description'
  s.homepage         = 'xxxxx'
  s.author           = { 'xx' => 'xx@xx.com' }
  
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.source           = { :git => '该地址是代码仓库的git地址', :tag => s.version.to_s }
end

代码提交

// 正常编写代码,提交之后,打tag、且push tag
$ git add .
$ git commit -m "创建Library组件库"      #提交修改到本地仓库
$ git remote add origin [git仓库地址]    #关联本地仓库与代码远端仓库
$ git pull origin master   #拉取远程仓库代码
$ git push origin master   #提交到代码远端仓库

# 注意:这个很重要
# 打上标签并且与podSpec中的tag保持一致
$ git tag -m "first create release" "0.1.1"
$ git push --tags


# 相关操作----------------------

# 删除本地tag
$ git tag -d v3.1.0
# 删除远程tag
$ git push origin :refs/tags/v3.1.0

2.配置仓库

创建本地spec库、关联远程spec库、校验合法性、push到远程:

// 查看本地有哪些关联的远程仓库
pod repo

// 添加本地仓库并且管理到远程仓库(一定要注意,这个是关联远程的spec仓库,不是代码仓库)
// pod repo add ABCLibrary https://XXXX
pod repo add 本地仓库名称 sourceUrl

// 关联之后,再次 pod repo 就能看到关联的仓库
// 之后就可以根据本地仓库的名字推送podspec配置到远程

// 在podspec 目录下 校验本地的podspec是否合法
pod lib lint --allow-warnings

// 该命令是把podspec文件推送到远程的配置仓库中
pod repo push 本地仓库名称 xxx.podspec --allow-warnings

3.常见问题:

1.cannot load such file -- xcodeproj:

pod lib create proName 
log:
Cloning `https://github.com/CocoaPods/pod-template.git` into `AirstarCommon`.
Configuring AirstarCommon template.
<internal:/usr/local/Cellar/ruby/3.0.1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- xcodeproj (LoadError)
    from <internal:/usr/local/Cellar/ruby/3.0.1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from /Users/zbchen/Documents/Dev/Library/LibraryCode/AirstarCommon/setup/ProjectManipulator.rb:1:in `<top (required)>'
    from ./configure:5:in `require_relative'
    from ./configure:5:in `block in <main>'
    from ./configure:4:in `each'
    from ./configure:4:in `<main>'

To learn more about the template see `https://github.com/CocoaPods/pod-template.git`.
To learn more about creating a new pod, see `https://guides.cocoapods.org/making/making-a-cocoapod`.


// 解决: 
gem install xcodeproj

2.not added the source repo that hosts the Podspec to your Podfile.:

// 私有pod依赖三方pod的使用:
Unable to find a specification for `Toast` depended upon by `AirstarCommon`

You have either:
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

// 要注意是不是souce 引入的问题:
source 'https://github.com/CocoaPods/Specs.git'

相关文章

  • iOS:CocoaPods制作私有库

    本章制作私有库方法省去了繁琐的Pod校验,快速简单制作私有库。 创建索引库 我使用的是GitHub 制作Pod 再...

  • 制作Pod库

    目录 一、公有Pod库制作 二、私有Pod库制作 三、subspec子库的制作 四、遇到的坑 一、公有Pod库制作...

  • 制作 CocoaPods 开源库

    CocoaPods 开源库的制作过程: 添加私有Pod仓库,用来存储私有Pod库的podspec文件,类似Coco...

  • 制作自己的Cocoapods

    制作自己的Cocoapods 创建自己私有pod库,官方推荐使用 pod lib create [pod name...

  • 私有pod制作

    1、创建并设置一个私有的Spec Repo pod repo add LocalSpecsName 私有仓库的地址...

  • 私有pod制作

    两个仓库 1.代码仓库 code repository 这个仓库是用来存放代码的,正常提交就可以,流程:1 创建p...

  • pod search 提示Unable to find a po

    制作cocoapods私有库时,输入pod search Person (Person为自己私有库)发现提示"[!...

  • Pod私有库制作

    ##Pod私有库制作 ####目录 +安装CocoaPods +创建远程内部私有Spec Repo仓库 +模板创建...

  • iOS 私有Pod制作时产生的问题

    制作新的Pod时,有依赖其他私有Pod,在Pod验证时报错,其中主要内容是:no implicit convers...

  • Pod私有库制作

    cd 到你要存放的文件夹下面 执行 2.创建podspec、LICENSE等文件 Press return to ...

网友评论

      本文标题:私有pod制作

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