Podspec调试/发布' vendored_framework '变体



我有一个扑动插件(让我们说它被命名为plugin),需要有一个单独的调试构建(说debug/foo.framework)和一个发布构建(release/foo.framework),他们应该在各自的应用程序构建中使用。有办法做到这一点吗?

Pod::Spec.new do |s|
...
s.xcconfig = { 'OTHER_LDFLAGS' => '-framework foo' }
s.vendored_frameworks = 'foo.framework'
end

我想要的,从概念上讲,是这样的(应该为dependency工作,但不为vendored_framework-说file: undefined method 'vendored_frameworks')

Pod::Spec.new do |s|
...
s.xcconfig = { 'OTHER_LDFLAGS' => '-framework foo' }
s.vendored_frameworks 'debug/foo.framework', :configurations => ['Debug']
s.vendored_frameworks 'release/foo.framework', :configurations => ['Release']

我也试过这个,但它失败与循环依赖:

Pod::Spec.new do |s|
s.name     = 'plugin'
...
s.xcconfig = { 'OTHER_LDFLAGS' => '-framework foo' }
s.subspec 'debug' do |cs|
cs.vendored_frameworks = 'debug/foo.framework'
end
s.subspec 'release' do |cs|
cs.vendored_frameworks = 'release/foo.framework'
end
s.default_subspecs = :none
s.dependency 'plugin/debug', :configurations => ['Debug']
s.dependency 'plugin/release', :configurations => ['Release']
end

我也有同样的问题(当处理React-Native时),并最终将插件分为3个pod。

my-plugin:

Pod::Spec.new do |s|
s.name         = "my-plugin"
s.dependency "my-lib-debug", :configurations => ['Debug']
s.dependency "my-lib-release", :configurations => ['Release']
end

my-lib-debug:

Pod::Spec.new do |s|
s.name         = "my-lib-debug"
s.ios.vendored_framework = 'ios/dependencies/debug/my-lib.xcframework'
end

my-lib-release:

Pod::Spec.new do |s|
s.name         = "my-lib-release"
s.ios.vendored_framework = 'ios/dependencies/release/my-lib.xcframework'
end

应用Podfile:

pod 'my-plugin', :path => 'path/to/my-plugin'
pod 'my-lib-debug', :path => 'path/to/my-lib-debug', :configurations => ['Debug']
pod 'my-lib-release', :path => 'path/to/my-lib-release', :configurations => ['Release']

最新更新