Search code examples
eclipseeclipse-plugineclipse-rcptycho

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). Now I need to provide this SDK to other developers, and they will make plug-ins, using this SDK to extend application features. So I built the plugins with the Tycho and gave binaries to juniors to use it as a Target Platform in their IDEs. But obviously, developers can't see javadoc in the Eclipse IDE and this makes their work much harder. 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.

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?

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. 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. 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. 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. Also I am aware of this Is there any way to automate Javadoc attachment for non-JRE bundles in Eclipse? 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.

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. 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.


Solution

  • 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.

    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. The IDE installed it, the help contribution appear, but PDE won't resolve javadoc. Once I added javadoc plugin to the Target Platform, resolving started to work correctly.