CocoaPods本地私有庫的創(chuàng)建
例子:
桌面 local_lib文件柬赐,包含
代碼框架:JBCategory ,目錄結(jié)構(gòu) classes -> category
宿主工程:JBProject
jiegou.png
1.創(chuàng)建本地庫
cd local_lib
git init
git add .
git commit -m "first"
2.創(chuàng)建podSpec文件
cd JBCategory
pod spec create JBCategory
xcode 打開 JBCategory.podspec 修改描述文件信息
s.summary = "JBCategory."
s.description = <<-DESC
JBCategory. 基礎(chǔ)組件之分類
DESC
s.license = "MIT"
s.source = { :git => "", :tag => "#{s.version}" }
3.描述文件的驗證 (私有庫可以忽略)
cd JBCategory
pod lib lint
出現(xiàn)?警告
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 創(chuàng)建Podfile文件 并設(shè)置
cd JBProject
pod init
vim Podfile
設(shè)置 (這個path 是為了能夠找到: JBCategory 目錄下的描述文件 JBCategory.podspec )
pod 'JBCategory', :path => '../JBCategory'
5.安裝 并編譯
pod install