跨插件共享单个 cocoa 框架副本
我有一组插件,一个用于通用代码的插件框架和一个主机应用程序。这些都位于单独的 Xcode 项目中(包括每个插件的单独项目)。最后,我需要能够在主机应用程序项目上单击构建并运行来构建所有插件、框架和主机应用程序,将它们打包并启动应用程序。
我知道如何将框架和插件包含到主机应用程序项目中,设置依赖项,复制操作等。我不确定的是如何在主机应用程序中包含插件框架的单个副本,以便各种插件使用而不是在每个插件包中包含一个副本。
I have a set of plugins, a plugin framework for common code and a host app. These are each in separate Xcode projects (including separate projects for each plugin). In the end, I need to be able to click build and run on the host app project to build all the plugins, the framework and host app, package them up and launch the app.
I know how to include the framework and plugins into the host app project, set up dependencies, copy actions, etc. What I am not sure about is how to include a single copy of the plugin framework in the host app for the various plugins to use rather than having a copy included in each plugin bundle.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试将插件弱链接到框架,将框架复制到应用程序的 Frameworks 文件夹中,然后以常规方式将应用程序链接到该副本。
Try weak-linking the plug-ins against the framework, copying the framework into the app's Frameworks folder, and linking, in the regular fashion, the app against that copy.
要让它在应用程序构建时自动将框架复制到应用程序的包中,请创建一个新的“复制文件”构建阶段。将框架拖入构建阶段。然后,在复制文件阶段执行获取信息并将目标选择器设置为“框架”。
To have it automatically copy the framework to your application's bundle when the app builds, make a new "Copy Files" build phase. Drag the framework into the build phase. Then, do a Get Info on the Copy Files phase and set the Destination picker to "Frameworks".