简体   繁体   English

为Eclipse插件提供javadoc插件,无源代码

[英]Providing javadoc plug-in for Eclipse plug-ins without source code

I made a RCP application comprised of the Eclipse RCP platform and my own ~20 Eclipse plug-ins (lets name it SDK for now).我制作了一个 RCP 应用程序,由 Eclipse RCP 平台和我自己的 ~20 个 Eclipse 插件组成(现在我们将其命名为 SDK)。 Now I need to provide this SDK to other developers, and they will make plug-ins, using this SDK to extend application features.现在我需要将这个 SDK 提供给其他开发者,他们将制作插件,使用这个 SDK 来扩展应用程序功能。 So I built the plugins with the Tycho and gave binaries to juniors to use it as a Target Platform in their IDEs.因此,我使用 Tycho 构建了插件,并将二进制文件提供给初级人员,以在他们的 IDE 中将其用作目标平台。 But obviously, developers can't see javadoc in the Eclipse IDE and this makes their work much harder.但显然,开发人员在 Eclipse IDE 中看不到 javadoc,这使得他们的工作更加困难。 Unfortunately I can not provide source code for these bundles to them, so the obvious solution to provide source-bundles is not acceptable.不幸的是,我无法向他们提供这些包的源代码,因此提供源包的明显解决方案是不可接受的。 I can generate javadoc separately and tell developers to attach it manually in the IDE, but thats a lot of plugins and IDE does not persist javadoc attachment to required bundles.我可以单独生成 javadoc 并告诉开发人员在 IDE 中手动附加它,但是插件很多,并且 IDE 不会将 javadoc 附加到所需的捆绑包中。

The question is , in general, what's the right way to make javadoc-only bundle without source code, which Eclipse IDE would automatically use as a javadoc source?问题是,一般来说,在没有源代码的情况下制作仅 javadoc 包的正确方法是什么,Eclipse IDE 会自动用作 javadoc 源代码?

I've managed to create the plug-in (like com.acme.sdk.doc ), where javadoc for my platform is generated and stored with tycho-document-bundle .我设法创建了插件(如com.acme.sdk.doc ),其中为我的平台生成 javadoc 并使用tycho-document-bundle存储。 And then I've installed this plug-in into Eclipse IDE, where my target platform is set, hoping for some magic with javadoc directory inside this bundle.然后我将此插件安装到 Eclipse IDE 中,我的目标平台已在其中设置,希望在此捆绑包中使用 javadoc 目录有一些魔力。 This doesn't work.这行不通。 Then I made tycho also generate TOC for the javadoc, and registered this TOC via org.eclipse.help.toc extension point.然后我让 tycho 也为 javadoc 生成 TOC,并通过org.eclipse.help.toc扩展点注册了这个 TOC。 The docs then showed in Eclipse Help, but the Java Editor still says that no javadoc attached, when hovering cursor on the classes from my SDK. The docs then showed in Eclipse Help, but the Java Editor still says that no javadoc attached, when hovering cursor on the classes from my SDK. At last try I also registered javadoc with org.eclipse.pde.core.javadoc extension point, but this also just does not work.最后尝试我还使用org.eclipse.pde.core.javadoc扩展点注册了 javadoc,但这也不起作用。 Also I am aware of this Is there any way to automate Javadoc attachment for non-JRE bundles in Eclipse?我也知道这一点是否有任何方法可以自动化 Eclipse 中非 JRE 包的 Javadoc 附件? similar problem.类似的问题。 Having tycho plug-in and PDE extension point, I feel like I'm close, just can't find a way to make IDE recognize this bundle.有了 tycho 插件和 PDE 扩展点,我觉得我很接近,只是找不到让 IDE 识别这个捆绑包的方法。

The only way I found so far is to generate javadoc for each platform bundle and place it in each bundle within doc directory - this way Eclipse IDE magically founds it.到目前为止,我发现的唯一方法是为每个平台包生成 javadoc 并将其放在doc目录中的每个包中 - 这样 Eclipse IDE 神奇地找到了它。 The drawback here is that I will have to build two version of SDKs: one for production without docs and one with it for developing.这里的缺点是我必须构建两个版本的 SDK:一个用于没有文档的生产版本,一个用于开发。

Well I figured out what the problem is, so I will post answer myself.好吧,我想出了问题所在,所以我会自己发布答案。 The plug-in, containing javadoc and org.eclipse.pde.core.javadoc extension definition must be in same Target Platform where plug-ins being documented are.包含 javadoc 和org.eclipse.pde.core.javadoc扩展定义的插件必须位于记录插件的同一目标平台中。

Previously I placed all the SDK plug-ins into the Target Platform of the junior's IDE, but the plug-in containing javadocs was placed into dropins directory of the Eclipse.之前我把所有的SDK插件都放到了初中IDE的Target Platform,但是包含javadocs的插件放到Z32F7222026696F30787889194Z的dropins目录下。 The IDE installed it, the help contribution appear, but PDE won't resolve javadoc. IDE 安装它,帮助贡献出现,但 PDE 不会解析 javadoc。 Once I added javadoc plugin to the Target Platform, resolving started to work correctly.一旦我将 javadoc 插件添加到目标平台,解析就开始正常工作。

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

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