Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SBT Scaladoc Configuration

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.

like image 240
user510159 Avatar asked Dec 10 '12 19:12

user510159


1 Answers

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/
like image 70
Mark Harrah Avatar answered Sep 26 '22 10:09

Mark Harrah