1 在Pod使用configurations修飾
configurations: ['Debug']
用于指定該依賴庫只是使用到Debug構(gòu)建目標(biāo)(target)里面,而不在其他(如Release)構(gòu)建目標(biāo)里面赘被,這樣做能有效減少 App Store 發(fā)布版本的體積。
def dev_pods
pod 'SwiftLint', '= 0.42.0', configurations: ['Debug']
pod 'SwiftGen', '= 6.4.0', configurations: ['Debug']
end
2 使用def來分組
def一般理解是宏定義扁远,在ruby里面可以將pod分組摄乒,添加到target清晰一些,如果一個(gè)工程有多個(gè)Target铺然,可以達(dá)到復(fù)用的效果翰萨。
target 'JZProject' do
dev_pods
core_pods
end
target 'JZProjectTests' do
core_pods
test_pods
end
3 pod outdated
CocoaPods 已經(jīng)為我們提供了pod outdated
命令脏答,我們可以用它一次查看所有 Pod 。
The following pod updates are available:
- Alamofire 5.3.0 -> 5.3.0 (latest version 5.4.1)