Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate links to standard library types in scaladoc?

I'm using sbt 0.13.7 and Scala 2.11.4.

In my build.sbt, I have:

autoAPIMappings := true

and in a File.scala:

/** scaladoc link to [[scala.concurrent.duration.FiniteDuration]] */

When running sbt doc, I’m getting:

[warn] ...:5: Could not find any member to link for "scala.concurrent.duration.FiniteDuration".
[warn] /** scaladoc link to [[scala.concurrent.duration.FiniteDuration]] */
[warn] ^

Now, when I replace autoAPIMappings := true with:

apiMappings += (scalaInstance.value.libraryJar ->
                url(s"http://www.scala-lang.org/api/${scalaVersion.value}/"))

the compiler still gives the warning.

What could be a solution?

like image 523
Michal Rus Avatar asked Dec 21 '14 10:12

Michal Rus


1 Answers

I wasn't able to reproduce this behavior using sbt 0.13.7 and Scala 2.11.4.

Do you have multi-project setup? If so make sure to explicitly add settings to each project, or define the common settings in ThisBuild scope.

project/build.properties

sbt.version=0.13.7

build.sbt

lazy val commonSettings = Seq(
  scalaVersion := "2.11.4",
  autoAPIMappings := true
)

lazy val root = (project in file(".")).
  aggregate(app).
  settings(commonSettings: _*)

lazy val app = (project in file("app")).
  settings(commonSettings: _*)

src/main/scala/Hello.scala

/** scaladoc link to [[scala.concurrent.duration.FiniteDuration]] */
object Hello extends App {

}
like image 109
Eugene Yokota Avatar answered Sep 19 '22 06:09

Eugene Yokota