SBT Scaladoc配置 [英] SBT Scaladoc Configuration

查看:88
本文介绍了SBT Scaladoc配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在SBT中配置Scaladoc,特别是标题,输出目录和类路径。

I'm trying to configure the Scaladoc in SBT, specifically the title, output directory and classpath.

我设法通过添加以下内容来定义标题: .sbt:

I managed to define the title by adding the following to build.sbt:

scalacOptions in (Compile, doc) ++= Opts.doc.title("Scala-Tools")

我不知道如何更改文档输出目录。

I can't figure out how to change the doc output directory.

我也不知道如何将jar添加到classpath。我要编辑类路径的原因是,当我引用它的类时,似乎scaladoc没有接听标准的Scala库,即[[scala.Option]]导致警告找不到链接的成员

I also can't figure out how to add jars to classpath. The reason I want to edit the classpath is because it appears the standard Scala library is not getting picked up by scaladoc when I refer to its classes, i.e. [[scala.Option]] leads to a warning "Could not find any member to link for "scala.Option"."

任何帮助,即使是以示例SBT配置的形式,也将不胜感激!

Any help, even in the form of an example SBT configuration would be appreciated!

我正在使用Scala 2.10-RC3和SBT 0.12.1。

I'm using Scala 2.10-RC3 and SBT 0.12.1.

推荐答案

Scala库位于类路径上,否则scaladoc会很快恢复错误。您看到的警告意味着scaladoc不知道如何链接到Option。为此,您需要使用 -external-urls 选项或 -doc-external-doc 选项在2.10.1中。即将到来的2.10.1的 scaladoc -help 的输出显示:

The Scala library is on the classpath, otherwise scaladoc would bail out with an error pretty quickly. The warning you see means that scaladoc doesn't know how to link to Option. For this, you need to use either the -external-urls option or the -doc-external-doc option coming in 2.10.1. The output of scaladoc -help for the upcoming 2.10.1 shows:

-doc-external-doc:<external-doc>  comma-separated list of classpath_entry_path#doc_URL pairs describing external dependencies.
-external-urls:<externalUrl(s)>   (deprecated) comma-separated list of package_names=doc_URL for external dependencies, where package names are ':'-separated

直到2.10.1失效的解决方案是使用 -external-uris

The solution until 2.10.1 is out is to use -external-uris:

-external-urls:scala=http://www.scala-lang.org/archives/downloads/distrib/files/nightly/docs/library/

这篇关于SBT Scaladoc配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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