CocoaPods本地私有库

CocoaPods本地私有库的创建

例子:
桌面 local_lib文件,包含
代码框架:JBCategory ,目录结构 classes -> category
宿主工程:JBProject

jiegou.png

1.创建本地库

cd local_lib
git init
git add .
git commit -m "first"

2.创建podSpec文件

cd  JBCategory
pod spec create JBCategory

xcode 打开 JBCategory.podspec 修改描述文件信息
s.summary      = "JBCategory."
s.description  = <<-DESC
JBCategory. 基础组件之分类
                   DESC
s.license      = "MIT"
s.source       = { :git => "", :tag => "#{s.version}" }

3.描述文件的验证 (私有库可以忽略)

cd  JBCategory
pod lib lint    

出现⚠警告
localhost:TestLog LouKit$ pod lib lint

 -> TestLog (0.0.1)
    - WARN  | homepage: The homepage has not been updated from default
    - WARN  | url: There was a problem validating the URL http://EXAMPLE/TestLog.
    - WARN  | license: Unable to find a license file

[!] TestLog did not pass validation, due to 3 warnings (but you can use `--allow-warnings` to ignore them).
[!] The validator for Swift projects uses Swift 3.0 by default, if you are using a different version of swift you can use a `.swift-version` file to set the version for your Pod. For example to use Swift 2.3, run: 
    `echo "2.3" > .swift-version`.
You can use the `--no-clean` option to inspect any issue.
警告可接受,无视!

4.宿主工程 JBProject 创建Podfile文件 并设置

cd  JBProject
pod init
vim Podfile

设置 (这个path 是为了能够找到: JBCategory 目录下的描述文件 JBCategory.podspec )
 pod 'JBCategory', :path => '../JBCategory'

5.安装 并编译

pod install

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容