记录podspec创建私有pod库流程,ios组件化管理。

本文详述了如何从零开始创建私有pod库,包括创建git仓库、配置podspec文件、验证及添加到私有repo的过程。同时,介绍了组件化项目管理的步骤,包括创建主工程、业务组件、分类工程等,展示了组件化管理的优势。
摘要由CSDN通过智能技术生成

最初是想整个组件化管理的案例,借鉴了一些文章:作者:SnaiLi 地址:https://www.jianshu.com/p/ea09fa02e871  和 作者:上海_光强  地址:https://www.jianshu.com/p/59c2d2c4b737 

1、创建一个git仓库用来做内部私有库的Spec Repo,命名为Pods(自己喜欢怎么命名都可以),如下图:

 

pods.git 用来管理控制 自己的组件.podspec 版本的

注意:一定要勾选为私有 (先有远程库,在本地构建)

当执行完毕以上的命令以后,回到仓库页面刷新,你会看到以下页面,说明成功创建README.md并上传到了git仓库了。

下面开始创建真正的私有库。
1、首先在第三方git的仓库,命名为NYKit,步骤跟上面的1和2一样的。
执行完以上的步骤,然后把项目拉下来本地,然后在本地进行开发。
我在工程目录下创建了NYKit文件夹,在这个文件夹下创建了NSString+MD5.h和NSString+MD5.m文件,如下图:

编辑完成以后,在终端执行以下命令把代码提交到远程仓库:

cd 到目标文件
git add -A
git commit -m "增加NSString+HDDmd5.h和NSString+HDDmd5.m文件"
git push origin master

如图:

2、可以通过如下代码创建podspec文件

pod spec create NYKit

3、用Xcode 或者 sublime text 打开NYKit.podspec文件进行编辑

编辑NYKit.podspec文件

#
#  Be sure to run `pod spec lint NYKit.podspec' to ensure this is a
#  valid spec and to remove all comments including this before submitting the spec.
#
#  To learn more about Podspec attributes see https://guides.cocoapods.org/syntax/podspec.html
#  To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
#

Pod::Spec.new do |spec|

  # ―――  Spec Metadata  ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  These will help people to find your library, and whilst it
  #  can feel like a chore to fill in it's definitely to your advantage. The
  #  summary should be tweet-length, and the description more in depth.
  #

  #项目名称
  spec.name         = "NYKit"
  #项目版本号
  spec.version      = "1.0.0"
  #项目的描述
  spec.summary      = "NYKit私有库"

  # 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!

  # 项目的描述
  spec.description  = <<-DESC
  NYKit私有库
                   DESC

  #项目的主页
  spec.homepage     = "https://gitee.com/ningYe_88"
  # spec.screenshots  = "www.example.com/screenshots_1.gif", "www.example.c
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值