1

我需要从我的podfile依赖平台中排除一个 pod。我不想添加另一个目标,我的podfile需求只有一个目标。

这里有一个例子:

target 'single_target' do
    #if platform is iOS
    pod 'PodForIOS'
    #if platform is OSX
    pod 'PodForOSX'
end

我的问题:如何指定哪些 pod 属于哪个平台?

谢谢

4

2 回答 2

0

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'
于 2016-12-13T15:33:54.733 回答
0

Podfile 中的目标是指 .xcproject 中的目标。这些都严格绑定到特定的平台: 为您的新目标选择一个模板

因此,您应该使用一个抽象目标(在 Podfile 中)和多个目标(在 Project 中)。

于 2016-12-13T15:51:07.503 回答