远程私有库设计优化
2018-06-03 本文已影响3人
coderST
问题描述 : 一般我们在设计组件的时候分为基础组件
功能组件
业务组件
假如在基础组件中写的模块越来越多,那我们在自己的真实项目里在引用的时候,难道要把基础组件
所有的模块都pod进工程吗??
- 问题分析:所以我们要对组件进行分层
- 1 :在工程spec文件里注释
#s.source_files = 'EmojiToolModel/Classes/**/*.{swift}'
-
2 :写好分层结构 如下:
屏幕快照 2018-06-03 23.11.34.png

- 3 : ../
git status
git add .
git commit -m"aa"
git origin
git push origin master
git tag
git tag '0.1.1' 与spec tag要一致
git push --tags
pod spec lint --allow-warnings

-
4 : 添加到本地索引库 并上传远程索引库
pod repo push XDSpecs EmojiToolModel.podspec --allow-warnings
屏幕快照 2018-06-03 23.17.11.png
-
5 podfile中的使用
- 写成多个
pod 'EmojiToolModel/Base'
pod 'EmojiToolModel/Category'
- 写成一个
pod 'EmojiToolModel', :subspecs => ['Base', 'Category']

