简体   繁体   English

适用于iOS和OS X的CocoaPods?

[英]CocoaPods for both iOS and OS X?

I have a static library that I've created for iOS 8 and have created a corresponding pod spec file so it can be delivered via CocoaPods. 我有一个为iOS 8创建的静态库,并创建了一个相应的pod spec文件,以便可以通过CocoaPods交付它。 I'd also like to build and distribute this library on OS X, as well. 我也想在OS X上构建和分发该库。 Is this possible? 这可能吗? How do I need to setup the project structure and the pod spec file(s)? 我需要如何设置项目结构和Pod规范文件? Do I need to do anything special? 我需要做些特别的事情吗?

Yes it's possible. 的,有可能。 See the multi-platform support documentation . 请参阅多平台支持文档 Basically you use spec.ios and spec.osx to specify platform-specific attributes - eg spec.ios.resources instead of spec.resources to specify iOS-specific resources. 基本上,您使用spec.iosspec.osx指定特定于平台的属性-例如,使用spec.ios.resources代替spec.resources指定特定于iOS的资源。 AFNetworking's podspec is a good example to have a look at. AFNetworking的podspec是一个很好的例子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM