我需要从我的podfile
依赖平台中排除一个 pod。我不想添加另一个目标,我的podfile
需求只有一个目标。
这里有一个例子:
target 'single_target' do
#if platform is iOS
pod 'PodForIOS'
#if platform is OSX
pod 'PodForOSX'
end
我的问题:如何指定哪些 pod 属于哪个平台?
谢谢
Finnaly我找到了解决方案
在podfile
:
target 'single_target' do
pod 'PodForIOS'
pod 'PodForOSX'
end
在.podspec
:
# Speficy platforms
s.platform = :ios, :osx
s.ios.deployment_target = '6.0'
s.osx.deployment_target = '10.8'
# Set dependency
s.ios.dependency 'PodForIOS'
s.osx.dependency 'PodForOSX'
Podfile 中的目标是指 .xcproject 中的目标。这些都严格绑定到特定的平台:
因此,您应该使用一个抽象目标(在 Podfile 中)和多个目标(在 Project 中)。