如何在doc任务中排除java源文件?
我正在将 sbt 0.11.2 用于混合 Java/Scala 项目。我意识到,当我从 sbt 中运行 doc 命令时,它不仅会在 src/main/scala 中为 Scala 源文件创建 scaladocs,而且还会为对于 src/main/java
中的 Java 源文件(sbt wiki 声称为 src/main/scala
创建它们,但这似乎不正确)。
然而,这看起来不太好。例如,对于具有静态方法的名为 Foo
的 Java 类,生成的 scaladoc 中有两个条目:一个 Foo
类和一个 Foo
对象。类仅列出构造函数,而对象列出静态方法。
有什么方法可以告诉 sbt 从 scaladoc 生成中排除 src/main/java 文件夹吗?我想为这些创建 javadoc。
I'm using sbt 0.11.2 for a mixed Java/Scala project. I've realized that when I run the doc
command from within sbt, it does not only create the scaladocs for the Scala source files in src/main/scala
, but also for the Java source files in src/main/java
(the sbt wiki claims to create them for src/main/scala
only that seems not true).
However, this does not look very well. For instance, for a Java class named Foo
with static methods there are two entries in the generated scaladoc: a Foo
class and a Foo
object. The class only lists the constructor and the object lists the static methods.
Is there any way I can tell sbt to exclude the src/main/java
folder from the scaladoc generation? I want to create javadocs for those instead.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
处理此问题的常用方法是使用
inspect
查看信息的来源,然后进行更改。检查doc
显示compile:sources(for doc)
,它是一个Seq[java.io.File]
,并且可以像这样进行更改this:您可以使用
showcompile:sources(for doc)
查看它包含的内容,然后set
更改它并再次检查它的值。The usual way to handle that is to use
inspect
to see where the information is coming from, and then change it. Inspecting atdoc
showscompile:sources(for doc)
, which is aSeq[java.io.File]
, and can be changed like this:You can use
show compile:sources(for doc)
to see what it contains, and thenset
to change it and check again its value.