您好,欢迎来到二三四教育网。
搜索
您的当前位置:首页2018-11-03 记录一次cocoapod的私有库的创建

2018-11-03 记录一次cocoapod的私有库的创建

来源:二三四教育网

最近到新的公司,准备考虑把公司的项目给组件化。

创建私有库是组件化的一部分

创建cocoapod管理项目

1:在git仓库里面创建一个管理.codspace文件的仓库

3:到pod的文件夹里面查看有没有加入进来

创建项目的私有库

1:创建私有库的代码仓库 

到本地,创建项目

在项目的主目录下面创建podspec文件 pod spec create +文件名

主目录 FFFA

name:私有库的名字

version:版本的 ===》git上面的tag

desctiption:描述

s.source_files = "DDDB/DDDB/A/**/*.{h,m}"

# s.dependency "JSONKit", "~> 1.4"

在项目创建pod私有库需要的文件的文件夹

代码push到git上去记得带上对应version ====》tag

//检查podspec文件格式是否正确

pod lib lint

 pod lib lint --use-libraries --allow-warnings

//检查私有库索引是否正确

pod spec lint --use-libraries --allow-warnings

将podspec文件推到索引库

pod repo push Repo FFFA.podspec --use-libraries --allow-warnings

创建主项目引入私有库

1:创建git

2:创建项目 cocoapod 主要是podFile

# Uncomment the next line to define a global platform for your project

# platform :ios, '9.0'

target 'Mast' do

  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks

  # use_frameworks!

  # Pods for Mast

  pod 'DDDB'

  pod 'FFFA'

  target 'MastTests' do

    inherit! :search_paths

    # Pods for testing

  end

  target 'MastUITests' do

    inherit! :search_paths

    # Pods for testing

  end

end

后面就是解耦和项目的模块拆分

Copyright © 2019- how234.cn 版权所有 赣ICP备2023008801号-2

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务