I'd like to setup ScalaDoc to link to the standard library, from SBT. I'm using 0.12.4 but I'm going to switch to 0.13 soon. Moreover, I'd like to make the setup simple by using 0.13's support.
The best option would be automatic mapping with 0.13's autoAPIMappings
:
//Requires SBT 0.13. However, automatic mapping does not work for the standard library.
autoAPIMappings := true
The scala-library
should support it because its pom sets info.apiURL
, and that's what SBT reads.
However, this does not work. Neither String
nor GenTraversable
are hyperlinked. last
shows that no option is added to scaladoc
arguments.
So:
- how can I fix
autoAPIMappings
? - are there alternatives?
- I've not observed this feature working, but maybe I just need another package which sets
info.apiUrl
. Any packages come to mind? Google seems unhelpful, and it's unobvious how to query for maven packages with some properties, or even how to do full-text search on poms.find ~/.m2 ~/.ivy2 -name '*.pom' -type f|xargs grep info.apiUrl
found no results among my 2G of local caches.
(This question might seem a dup of SBT Scaladoc Configuration, but it's for updated configuration and with a different SBT version, so the question is different; moreover, the existing answer shows a deprecated solution).
I know no solution for
autoAPIMappings
, but here are some alternatives.A possible alternative, using 0.13's
apiMappings
, one can setup a manual mapping. On my system,last doc
shows that this adds-doc-external-doc:/Users/pgiarrusso/.sbt/boot/scala-2.10.2/lib/scala-library.jar#http://www.scala-lang.org/api/2.10.2/
to the command line, and it works.This requires Scaladoc 2.10.2 or later.
Alternatively, one can add the same option by hand. This is necessary on SBT 0.12. The main nontrivial step is to find the right library.
In 0.13 syntax:
In 0.12 syntax:
This option still requires Scaladoc 2.10.2.
Finally, on older Scaladocs one can use
-external-urls
, even though it is less precise (and thus deprecated), as @MarkHarrah had suggested earlier.In 0.13 syntax:
In 0.12 syntax:
Finally, note that in all cases occurrences of
String
do not become a hyperlink, maybe because of some bug with type aliases. However, other types (includingGenTraversable
) are hyperlinked.