我已经为 iOS 发布了一个 CocoaPod,并希望在 OS X 上也可以使用它。我已经修复了我的 PodSpec,以便它适用于 iOS 和 Mac OS X:
Pod::Spec.new do |s|
s.name = "EveryoneAPI"
s.version = "0.9.5"
s.summary = "An objective-c wrapper for EveryoneAPI.com's API"
s.description = <<-DESC
To retrieve all information for EveryoneAPI use the following:
EveryoneAPI *everyoneAPI = [[EveryoneAPI alloc] initWithAccountSID:@"ACb8444c3013dc40518e46b48c91f82ba0" withAuthToken:@"AUe90abecac85645ca8a314d41e9b55079"];
[everyoneAPI getInformation:EveryoneAPIReturnAllInfo forPhoneNumber:@"5551234567" withSuccessHandler:^(EveryoneAPIResponseObject *responseObject){
} withErrorHandler:^(NSError *error, NSNumber *statusCode, NSString *readableError){
}];
DESC
s.homepage = "https://github.com/msencenb/EveryoneAPI"
s.license = 'MIT'
s.author = { "Matt Sencenbaugh" => "my_email@gmail.com" }
s.source = { :git => "https://github.com/msencenb/EveryoneAPI.git", :tag => s.version.to_s }
s.ios.deployment_target = "8.0"
s.osx.deployment_target = "10.9"
s.requires_arc = true
s.source_files = 'Pod/Classes'
s.resource_bundles = {
'EveryoneAPI' => ['Pod/Assets/*.png']
}
end
这是一个仅使用 Foundation 类的简单 pod,因此它不需要单独的资源。一切都很好,但是在 pod lib lint 期间,我收到以下错误:
- NOTE | [OSX] error: /var/folders/yd/kfjb5s4d1vv57fv5lhtm9lbh0000gn/T/CocoaPods/Lint/build/Release/EveryoneAPI.bundle: No such file or directory
有点道理,我在 Xcode 开发部分的 EveryoneAPI.bundle 目标设置为创建 iOS 包。我一生都无法弄清楚如何让 pod 以 OSX 为目标。有没有好的指南?我要添加新目标吗?如果是这样,我如何告诉 podspec 查找该特定捆绑包而不是 iOS 捆绑包?