简体   繁体   English

在Cocoa框架中包含插件

[英]Including plugins in Cocoa frameworks

In the build process of an OS X framework I have a Copy Files build step, which copies 2 bundles to the PlugIns destination. 在OS X框架的构建过程中,我有一个“ Copy Files构建步骤,该步骤将2个捆绑软件复制到PlugIns目标位置。

When I look in the built framework, they end up in Framework /Versions/A/Resources. 当我查看构建的框架时,它们最终出现在Framework / Versions / A / Resources中。

The related step in the build process: 构建过程中的相关步骤:

PBXCp /Users/nephilim/Library/Developer/Xcode/DerivedData/Graphing_Fun-egwutjdrujbsecgqukeyejeljxoo/Build/Products/Debug/GPHPieChart.bundle /Users/nephilim/Library/Developer/Xcode/DerivedData/Graphing_Fun-egwutjdrujbsecgqukeyejeljxoo/Build/Products/Debug/Grapher.framework/Versions/A/Resources/GPHPieChart.bundle cd "/Users/nephilim/Documents/Development/Cocoa Projects/Graphing Fun" builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/nephilim/Library/Developer/Xcode/DerivedData/Graphing_Fun-egwutjdrujbsecgqukeyejeljxoo/Build/Products/Debug/GPHPieChart.bundle /Users/nephilim/Library/Developer/Xcode/DerivedData/Graphing_Fun-egwutjdrujbsecgqukeyejeljxoo/Build/Products/Debug/Grapher.framework/ Versions/A/Resources PBXCp /用户/ nephilim /库/开发人员/ Xcode / DerivedData / Graphing_Fun-egwutjdrujbsecgqukeyejeljxoo / Build /产品/Debug/GPHPieChart.bundle/Users/nephilim/Library/Developer/Xcode/DerivedData/Graphing_Fund Grapher.framework / Versions / A / Resources / GPHPieChart.bundle cd“ / Users / nephilim / Documents / Development / Cocoa Projects / Graphing Fun” Built-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/nephilim/Library/Developer/Xcode/DerivedData/Graphing_Fun-egwutjdrujbsecgqukeyejeljxoo/Build/Products/Debug/GPHPieChart.bundle / Users / nephilim / Library / Developer / XGraph / Dejede / JGraph / Dejede / Build /产品 /Debug/Grapher.framework/ 版本/ A /资源

When I run the code below, I get the folder Framework /Plugins: 当我运行下面的代码时,我得到文件夹Framework / Plugins:

[[NSBundle bundleForClass:[self class]] builtInPlugInsPath]

As such, I can't use my plugins this way. 因此,我不能以这种方式使用我的插件。 Is this an expected result, or a bug? 这是预期结果还是错误?

Context: I'd like to built my framework as basic as possible and extend it with plugins over time. 上下文:我想尽可能地构建我的框架,并随着时间的推移使用插件对其进行扩展。

update 更新

I tried using "PlugIns" as the destination for the copy files phase and it doesn't seem to work, Using "Wrapper" as the destination with "PlugIns" as the subpath does work however. 我尝试使用“ PlugIns”作为复制文件阶段的目标,但它似乎不起作用,但是,使用“ Wrapper”作为目标,将“ PlugIns”作为子路径确实可以工作。

在此处输入图片说明


previous answer 先前的答案

Change your copy files phase to copy your plugins to the plugins path... 更改复制文件阶段,将插件复制到插件路径...

在此处输入图片说明

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

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