SBT Scaladoc Configuration

给你一囗甜甜゛ 提交于 2020-01-02 01:10:14

问题


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

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.

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"."

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

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


回答1:


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

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/


来源:https://stackoverflow.com/questions/13807427/sbt-scaladoc-configuration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!