将 javadoc 移植到 ant 任务:如何实现“[@files]”选项?

发布于 2024-11-29 23:32:40 字数 392 浏览 2 评论 0原文

我正在尝试将 javadoc 添加到我的 ant 构建过程中,但实际上并不知道如何将 javadoc 的一个选项“转换”为 ant 任务“< javadoc >”。 这里是javadoc用法:

usage: javadoc [options] [packagenames] [sourcefiles] [@files]

这是我已经尝试过的:

    <javadoc sourcefiles="build/sourcefiles.txt">
    </javadoc>

我想在我的ant任务中使用选项[@files],但找不到正确的方法......你有什么想法吗?

提前致谢...

I'm trying to add javadoc to my ant build process do not really have an idea how to "convert" one option of javadoc into the ant task "< javadoc >".
Here the javadoc usage:

usage: javadoc [options] [packagenames] [sourcefiles] [@files]

This is what I already tried:

    <javadoc sourcefiles="build/sourcefiles.txt">
    </javadoc>

And I want to have the option [@files] in my ant task, but could not find a proper way to do so...may you have any idea?

Thanks in advance...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

鱼窥荷 2024-12-06 23:32:40

最简单(原始)的方法是使用 arg 子元素来提供更多命令行参数。

<javadoc>
  <arg value="@build/sourcefiles.txt" />
</javadoc>

但我认为这种方式行不通,因为 javadoc 任务至少需要给出所需的属性。

要从文件中获取文件列表,filelist 资源集合与 loadfile 任务可能会有所帮助:

<loadfile property="sourcefiles-list"
          srcFile="build/sourcefiles.txt"
          encoding="US-ASCII" />
<javadoc destdir="...">
  <sourcefiles>
    <filelist files="${sourcefiles-list}"/>
  </sourcefiles>
</javadoc>

实际上,packagelist 属性可能是你想要什么:

<javadoc destdir="..." sourcepath="..."
         packageList="build/sourcefiles.txt">
</javadoc>

首先尝试这个(我不确定它是否也接受那里的文件名)。

The simplest (primitive) way would be to use the arg subelement to supply more command line arguments.

<javadoc>
  <arg value="@build/sourcefiles.txt" />
</javadoc>

But I suppose that this will not work this way, since the javadoc task wants at least the required attributes to be given.

To take a list of files from a file, the filelist resource collection together with the loadfile task may help:

<loadfile property="sourcefiles-list"
          srcFile="build/sourcefiles.txt"
          encoding="US-ASCII" />
<javadoc destdir="...">
  <sourcefiles>
    <filelist files="${sourcefiles-list}"/>
  </sourcefiles>
</javadoc>

Actually, the packagelist attribute might be what you want:

<javadoc destdir="..." sourcepath="..."
         packageList="build/sourcefiles.txt">
</javadoc>

Try this first (I'm not sure if it also accepts file names there).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文