Ant 脚本中的 FileSet 有问题吗?
我正在使用 Ant 脚本生成 javadoc,我只需要 Ant 来查找基于特定模式的一些类,所以我写道:
<javadoc access="public" source="1.6" sourcepath="src" destdir="dest" >
<fileset dir="src" casesensitive="yes" defaultexcludes="yes">
<filename name="**/ABC*.java"/>
</fileset>
</javadoc>
这意味着我只希望 Ant 查找仅以“ABC”开头的源文件并为这些文件生成 javadoc。但是,对于以“ABC”开头的每个文件,结果都是重复的。
我做错了什么吗?
谢谢
I am using Ant script to generate javadoc and I just only wnt Ant to look for some classes based on a certain pattern, so I wrote:
<javadoc access="public" source="1.6" sourcepath="src" destdir="dest" >
<fileset dir="src" casesensitive="yes" defaultexcludes="yes">
<filename name="**/ABC*.java"/>
</fileset>
</javadoc>
That means I only want Ant to look for source file that starts with "ABC" only and generate javadoc for these files. However, the results are awayls duplicate for each file starting with "ABC".
Did I do something wrong?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
问题来自于同时使用
sourcepath
属性和嵌套的fileset
标记。如果您废弃sourcepath
并只拥有fileset
,那么应该没问题。即,而不是仅仅这样做:
The problem comes in from using both the
sourcepath
attribute and the nestedfileset
tag. If you scrap thesourcepath
and just have thefileset
, you ought to be fine. i.e., instead ofjust do:
您不能在
javadoc
任务中使用复杂的文件模式。Ant
Javadoc
类的 javadoc 提到这是一个限制:==Begin Quote===
当前已知的限制是:
模式必须采用“xxx.*”形式,所有其他模式都必须采用“xxx.*”形式不起作用。
...
==引用结束===
You cannot use complex file-patterns in the
javadoc
task.The javadoc for the Ant
Javadoc
class mentions this as a limitation:==Begin Quote===
Current known limitations are:
patterns must be of the form "xxx.*", every other pattern doesn't work.
...
==End Quote===
您可以尝试在文件集中使用嵌套的
include
来代替filename
或使用 javadoc 标记中的 packagenames 属性作为
Can you try with a nested
include
inside fileset, instead offilename
likeor use the packagenames attribute within javadoc tag as