aboutsummaryrefslogtreecommitdiff
path: root/build.sbt
diff options
context:
space:
mode:
authorSchuyler Eldridge2020-03-23 18:59:38 -0400
committerGitHub2020-03-23 22:59:38 +0000
commitbdac6e1c55694f1562a56b2eb0716733bd2f1fc0 (patch)
treecfc5757db2ddc1df7dce6ffa6f61e61479f0667a /build.sbt
parent5efcde9fccf81c9ee03a1029b1a41fa4345d9fba (diff)
Support Java API doc Scaladoc/Unidoc References (#1420)
* Link to Java API Documentation This adds a build.sbt apiMappings to allow for Scaladoc/Unidoc linking to Java API documentation. This uses the exact strategy that Scala upstream uses for linking. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Add example of Java and Scala API docs linking Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Diffstat (limited to 'build.sbt')
-rw-r--r--build.sbt12
1 files changed, 12 insertions, 0 deletions
diff --git a/build.sbt b/build.sbt
index 9d741bdf..36aed369 100644
--- a/build.sbt
+++ b/build.sbt
@@ -136,6 +136,18 @@ lazy val publishSettings = Seq(
lazy val docSettings = Seq(
doc in Compile := (doc in ScalaUnidoc).value,
autoAPIMappings := true,
+ apiMappings ++= {
+ Option(System.getProperty("sun.boot.class.path")).flatMap { classPath =>
+ classPath.split(java.io.File.pathSeparator).find(_.endsWith(java.io.File.separator + "rt.jar"))
+ }.map { jarPath =>
+ Map(
+ file(jarPath) -> url("https://docs.oracle.com/javase/8/docs/api")
+ )
+ }.getOrElse {
+ streams.value.log.warn("Failed to add bootstrap class path of Java to apiMappings")
+ Map.empty[File,URL]
+ }
+ },
scalacOptions in Compile in doc ++= Seq(
"-diagrams",
"-diagrams-max-classes", "25",