我目前正在开发一个 iOS SDK,使用 Cocoapods 来管理部署并使用 Jazzy 来生成文档。我最近在一个子规范中添加了对 Google ads v8 的依赖项,并在另一个子规范中添加了对 Google ads v7 的另一个依赖项,如下所示:
s.subspec 'Admob' do |admob|
admob.source_files = 'MyLib/Classes/admob/**/*.{swift,h,m}'
admob.dependency 'MyLib/Core'
admob.dependency 'Google-Mobile-Ads-SDK', '~> 8.0'
admob.xcconfig = { 'OTHER_SWIFT_FLAGS' => '$(inherited) -D SDK_ADMOB' }
end
s.subspec 'Admob7' do |admob|
admob.source_files = 'MyLib/Classes/admob7/**/*.{swift,h,m}'
admob.dependency 'MyLib/Core'
admob.dependency 'Google-Mobile-Ads-SDK', '~> 7.0'
admob.xcconfig = { 'OTHER_SWIFT_FLAGS' => '$(inherited) -D SDK_ADMOB' }
admob.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
admob.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
end
一切正常,除非我想用 Jazzy 生成文档。这是我的conf:
documentation: "*.md"
xcodebuild_arguments: -scheme,Tests
module: MyLib
sdk: iphone
source_directory: MyLib
podspec: MyLib.podspec
theme: fullwidth
readme: USERGUIDE.md
当我运行时,我遇到bundle exec jazzy
了冲突,因为它希望你同时使用我的所有子规范:
Using config file /Users/***/***/.jazzy.yaml
Analyzing dependencies
bundler: failed to load command: jazzy (/usr/local/lib/ruby/gems/2.7.0/bin/jazzy)
Pod::Informative: [!] CocoaPods could not find compatible versions for pod "Google-Mobile-Ads-SDK":
In Podfile:
MyLib/Admob (from `/Users/***/***`) was resolved to 2.8.0, which depends on
Google-Mobile-Ads-SDK (~> 8.0)
MyLib/Admob7 (from `/Users/***/***`) was resolved to 2.8.0, which depends on
Google-Mobile-Ads-SDK (~> 7.0)
有人可以告诉我是否可以从我的文档生成中排除一个或多个子规范?