pod lib create 建立私有库

  1. 远程仓库新建repository 作为podSpec
  2. 远程仓库clone本地 pod repo add <Specs_name> <git_url>
  3. 新建本地repository pod lib create
  4. Finder中找到PodDemo/Classes, 编写代码文件以及podspecs文件。执行pod install
  5. 远程仓库新建对应项目, 并同步:
      ① git add . 
      ② git commit -m”commit message” 
      ③ git remote add origin https://<远程仓库地址>  
      ④ git push origin master
      git branch --set-upstream-to=origin/master master //关联本地分支与远程分支
      git push —tags  // 推送tag
      git tag ‘0.1.2’ // 打tag
  1. 本地仓库验证: 当仓库依赖其他源时 需要列出源地址,否则会找不到依赖库发生错误。
  pod lib lint --sources='<source1>,<source2>' --allow-warnings --no-clean --verbose
  1. 推送podspecs到远程索引库
  pod repo push <Specs_name> <local.specs>
  1. 安装 cocoapods packager sudo gem install cocoapods-packager
  2. 在podspec文件目录下执行: pod package xx.podspec 根据podspec的配置将远程仓库代码打包成私有库
  3. pod package 常用命令如下:
# Overwrite existing files.
# 是否覆盖已存在的文件
--force 

# Do not mangle symbols of depedendant Pods.
--no-mangle

# Generate embedded frameworks. 
# 生成静态Framework
--embedded

# Generate static libraries.
# 生成静态Library
--library

# Generate dynamic framework. 
# 生成动态Framework
--dynamic

# Bundle identifier for dynamic framework
# 动态Framework Bundle identifier
--bundle-identifier 

# Exclude symbols from dependencies.
# 不包含依赖的符号表,动态库不能包含这个命令
--exclude-deps 

# Build the specified configuration (e.g. Debug). Defaults to Release
# 生成的库是Debug还是Release,默认是Release。--configuration=Debug 
--configuration

# Only include the given subspecs
# 只给指定的子库打包
--subspecs

# The sources to pull dependant pods from (defaults to https://github.com/CocoaPods/Specs.git)
# 存在私有依赖
--spec-sources=private,https://github.com/CocoaPods/Specs.git 
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 1.git的安装 1.1 在Windows上安装Git msysgit是Windows版的Git,从https:/...
    落魂灬阅读 12,713评论 4 54
  • 1. 安装 Github 查看是否安装git: $ git config --global user.name "...
    Albert_Sun阅读 13,721评论 9 163
  • Git常用语法 [TOC] Git简介 描述 ​ Git(读音为/gɪt/。)是一个开源的分布式版本控制系统,...
    君惜丶阅读 3,591评论 0 13
  • Git 命令行学习笔记 Git 基础 基本原理 客户端并不是只提取最新版本的文件快照,而是把代码仓库完整的镜像下来...
    sunnyghx阅读 3,952评论 0 11
  • 学经计划:137 读经内容:《易经》9—11《老子》41一50《诗词启蒙》41—50 学经时间:第六周第四天 参加...
    妈妈宝贝嘟嘟阅读 148评论 0 0