我正嘗試將Google Mobile Ads SKD安裝到我的Xcode項目中。我安裝的CocoaPods然後初始化一個Podfile到我的項目:Podfile中的目標內的目標
# Uncomment the next line to define a global platform for your project
platform :ios, '10.2'
target 'Cubical' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Cubical
target 'CubicalTests' do
inherit! :search_paths
# Pods for testing
end
target 'CubicalUITests' do
inherit! :search_paths
# Pods for testing
end
end
不過,我不明白爲什麼有我的主要項目(立方體)內的目標。我從來沒有真正使用CubicalTests或CubicalUITests,因爲我不需要測試我的UI或任何代碼片段。 我正在考慮刪除這兩個文件夾。
我的問題是,
1)是否有去除從我的Xcode項目的測試和UITests文件有任何缺點?如果我這樣做,我可以直接從Podfile中刪除這兩個目標嗎?
2)假設我將保留這兩個目標。我需要爲所有三個目標添加吊艙嗎?或者兩個嵌套目標是否繼承目標'Cubical'的任何Pod莢
3)我需要向鏈接框架添加Google Mobile Ads SDK嗎?或者這已經由Cocoapods完成了?
我最終角果應該是這樣的:
# Uncomment the next line to define a global platform for your project
platform :ios, '10.2'
target 'Cubical' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'Google-Mobile-Ads-SDK'
# Pods for Cubical
target 'CubicalTests' do
inherit! :search_paths
# Pods for testing
end
target 'CubicalUITests' do
inherit! :search_paths
# Pods for testing
end
end
令人驚歎的答案,但是嵌套目標和全局目標之間有什麼區別? (如果這甚至是適當的術語,而不是Ruby的經驗) – Pablo
@Pablo,看到更新的答案,我不確定全球目標。 –