有什么方法可以自动在Eclipse中为非JRE包自动生成Javadoc附件? [英] Is there any way to automate Javadoc attachment for non-JRE bundles in Eclipse?

查看:213
本文介绍了有什么方法可以自动在Eclipse中为非JRE包自动生成Javadoc附件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,这与Java SE Javadocs无关。



我们有一个大型的基于Java的平台,带有大约20个API捆绑包。对于使用我们平台的人,我们希望工具提示和其他此类内置文档支持能够像Java API一样发挥作用。



我们的Javadocs是



Eclipse似乎并不能保留Javadoc,附件-也就是说,当您将Javadocs附加到一个包时,它可以工作,但是当您重新启动Eclipse时,该附件会丢失。



具有至少20个API包,并且使用我们的平台至少有10个或更多项目的典型工作区,每次重新启动Eclipse都必须手动将Javadocs附加到每个项目的每个引用包中是不可行的(例如,可能是200个手动附件)。

有没有办法使它自动化?尽管不是每次启动Eclipse时都必须运行的脚本解决方案,但我并没有高于它,尽管很明显,如果它工作(对Java API的方式)会更好。 (为此,我希望它也可以用于Apache Commons,Bouncy Castle,Android等各种功能。)



谢谢...

解决方案

可以通过在目标平台上提供一个包含Javadoc的捆绑包来解决此问题(不包含源代码)。以下是实现此目的的步骤:


  1. 创建包含API完整Javadoc的插件

  2. 通过定义扩展 org.eclipse.pde.core.javadoc 扩展点如下所示:


 <扩展点= org.eclipse.pde.core.javadoc> 
< javadoc path =" javadoc"> <!-API javadoc目录的相对路径(也可以是URL)->
< plugin id =" com.acme.core" />
< plugin id =" com.acme.ui" />
<!-列出文档中已记录的插件->
< / javadoc>
< / extension>



  1. 导出此插件并将其添加到目标平台

如果您的Javadoc已经可以通过URL在线使用,则只需创建定义扩展名的插件并将URL设置为Javadoc的路径即可元素:

 < javadoc path =" https://acme.com/apidocs"> 

Eclipse IDE将通过PDE扩展自动为您的捆绑包解析Javadoc位置。


First, this is not about the Java SE Javadocs. That's working fine.

We have a large Java-based platform, with about 20 API bundles. For people who use our platform, we'd like tooltips and other such built-in doc support to work just as it already does for the Java APIs.

Our Javadocs are at a URL available to those who use our platform, and work properly when manually attached to a referenced bundle using the usual approach.

Eclipse doesn't seem to persist the Javadoc attachment - that is, when you attach Javadocs to a bundle, it works, but when you restart Eclipse, that attachment is lost.

With at least 20 API bundles, and a typical workspace using our platform having at least 10 or more projects, having to manually attach Javadocs to each referenced bundle for each project is not workable (could be 200 manual attachments, e.g.) each time Eclipse is restarted.

Is there any way for this to be automated? I'm not above some kind of scripting solution, even if it had to be run each time Eclipse was started, though clearly, it would be better if it just "worked", the way it does for the Java APIs. (For that matter, I'd love this to also work for various things like Apache Commons, Bouncy Castle, Android, etc.).

Thanks...

解决方案

This problem can be solved by providing a bundle containing Javadoc with your Target Platform (no source code included). Here are the steps to achieve this:

  1. Create plug-in containing full Javadoc of your API
  2. Define extension via org.eclipse.pde.core.javadoc extension point in this plug-in like this:

<extension point="org.eclipse.pde.core.javadoc">
    <javadoc path="javadoc"> <!-- relative path to the API javadoc directory (can also be a URL) -->
        <plugin id="com.acme.core"/>
        <plugin id="com.acme.ui"/>
        <!-- list plug-ins which have been documented in the docs -->
    </javadoc>
</extension>

  1. Export this plug-in and add it to the Target Platform

In case your Javadoc is already available online via URL, you can just create the plug-in defining an extension and set a URL as a path of the Javadoc element:

<javadoc path="https://acme.com/apidocs">

Eclipse IDE will automatically resolve Javadoc location through the PDE extension for your bundles.

这篇关于有什么方法可以自动在Eclipse中为非JRE包自动生成Javadoc附件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆