多个 javadoc 命令可以输出到同一目录层次结构吗?
我有多个目标,在我的构建文件中将其称为 Foo 和 Bar。假设 Foo 首先被构建。每个目标都包含运行 javac、jar 和 javadoc 的任务。
我希望两个 javadoc 命令使用相同的目标目录;然而,Bar 的 javadoc 命令生成一个包列表文件,该文件覆盖 Foo 的包列表。另外,我希望 Bar 的 javadoc 能够链接到为 Foo 生成的 javadoc,但只有当有一个它可以读取的包列表时它才能这样做——这将位于我希望它写入的同一位置。
我不创建单独的 Javadoc 目标的原因是我希望能够为 Foo 构建 javadoc,无论 Bar 是否编译,反之亦然。
(如何)我可以将多个 javadoc 命令写入同一个基目录吗?
I have multiple targets, which I'll call Foo and Bar, in my build file. Assume that Foo is built first. Each target consists of tasks to run javac, jar, and javadoc.
I would like for both javadoc commands to use the same destination directory; however,Bar's javadoc command produces a package-list file that overwrite's Foo's package-list. Additionally, I would like for Bar's javadoc to be able to link to javadoc generated for Foo, but it can only do so if there is a package-list it can read -- which would be at the same location I want it to write.
The reason I don't create a separate Javadoc target is that I would like to be able to build the javadoc for Foo, whether or not Bar compiles, and vice versa.
(How) can I have multiple javadoc commands write to the same base directory?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为没有一个好的方法可以做到这一点 - 不仅有包列表,还有许多其他文件将由两个 javadoc 进程(不同地)重新生成:
这些是可能的替代方案:
生成单独的输出,但将它们相互链接(使用
-link
或-linkoffline
选项)。使用已知可编译的其他项目的最新版本生成公共输出。为此,请使用您的版本控制系统。
偶尔会使用两者生成大输出(即来自稳定版本)。
然后仅重新生成项目的部分(到新目录中),然后将其复制到大输出上(不包括顶级目录中的文件,即概述和框架集文件)。顶级框架集中的索引、树和类列表不会是最新的,但是这些更改的频率如何?
如果您想投入大量时间,可以修改第三个选项,将新的顶级文件合并到现有的文件中。祝你好运。
I don't think there is a good way to do this - there is not only the package-list, but also a number of other files which will regenerated (differently) by both javadoc processes:
These are possible alternatives:
Generate separate outputs, but link them to each other (using the
-link
or-linkoffline
option).Generate a common output using the last version of the other project that was known to compile. Use your version control system for this.
Occassionally generate a big output with both (i.e. from stable versions).
Then regenerate only the part for your project (into a new directory), and then copy it (without the files in the top level directory, i.e. overview and the frameset files) over the big output. The index, tree, and class lists in the top-level frameset will not be up-to date, but how often do these change anyway?
If you want to invest lots of time, you could modify the third option to merge the new top-level files into the existing ones. Good luck.