【发布时间】:2016-07-12 15:34:12
【问题描述】:
我正在通过 CocoaPods 建立一个 Swift 框架。
目标是:
- 为 Podspec 使用私有存储库
- 让框架以二进制形式分发(而不是源代码)
我已经阅读了CocoaPods frameworks、Making a CocoaPod 以及其他参考资料(似乎无法包含超过 2 个具有当前 SO 声誉的链接,但我可以在 cmets 中指出来源)。
我使用的 Podspec 是:
Pod::Spec.new do |s|
s.name = 'SDK'
s.version = '0.0.1'
s.summary = 'My SDK'
s.description = 'SDKs description'
s.homepage = 'https://github.com/XXX/sdk'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'XXX' => 'xxx@xxx.com' }
s.source = { :git => 'https://github.com/XXX/sdk.git', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
s.platform = :ios, '9.0'
s.source_files = 'SDK/Classes/**/*'
s.preserve_paths = 'Frameworks/SDK.framework'
s.ios.vendored_frameworks = 'Frameworks/SDK.framework'
end
Pods xcode 项目已更改为除了标准(arm64、armv7)之外还构建 i386 架构。
只要我将 SDK.framework 文件复制到 .podspec 文件夹中的 /Frameworks 文件夹,此规范就可以在本地成功验证:
pod lib lint
问题:当我尝试将规范推送到 repo 时,验证失败,如下面的输出所示:
pod repo push mySDKPrivateRepo SDK.podspec
Validating spec
-> SDK (0.0.1)
- ERROR | [iOS] file patterns: The `source_files` pattern did not match any file.
- ERROR | file patterns: The `preserve_paths` pattern did not match any file.
- ERROR | [iOS] file patterns: The `vendored_frameworks` pattern did not match any file.
[!] The `SDK.podspec` specification does not validate.
问题:
- 如何在将 podspec 验证推送到 repo 时成功?
其他说明:
- 手动将 SDK.framework 复制到 /Frameworks。
- 如果我在 Pods Xcode 项目中包含 Copy Files 构建步骤,则不会复制该文件。
- 使用 CocoaPods 1.1.0。
【问题讨论】:
-
@Galazy - 你找到答案了吗?