Skip to content

Commit

Permalink
Add external mappings for scaladoc
Browse files Browse the repository at this point in the history
External mappings allow linking to other project's documentation,
which makes it easier for users to understand the API.
  • Loading branch information
Flowdalic committed Sep 18, 2023
1 parent 635a451 commit e4e7743
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,23 @@ trait OsModule extends OsLibModule { outer =>
def ivyDeps = Agg(Deps.geny)

def artifactName = "os-lib"

val scalaDocExternalMappings = Seq(
".*scala.*::scaladoc3::https://scala-lang.org/api/3.x/",
".*java.*::javadoc::https://docs.oracle.com/javase/8/docs/api/",
s".*geny.*::scaladoc3::https://javadoc.io/doc/com.lihaoyi/geny_3/${Deps.geny.dep.version}/",
).mkString(",")

def conditionalScalaDocOptions: T[Seq[String]] = T {
if (ZincWorkerUtil.isDottyOrScala3(scalaVersion()))
Seq(
s"-external-mappings:${scalaDocExternalMappings}"
)
else Seq()
}

def scalaDocOptions = super.scalaDocOptions() ++ conditionalScalaDocOptions()

}

object os extends Module {
Expand Down

0 comments on commit e4e7743

Please sign in to comment.