Skip to content

Commit ddca6ef

Browse files
committed
scaladoc
1 parent f78b18d commit ddca6ef

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

build.sbt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,26 @@ ThisBuild / crossScalaVersions := Seq("2.11.12", "2.12.15", "2.13.8", "3.0.2")
1313

1414
ThisBuild / organizationHomepage := Some(url("https://github.com/swagger-akka-http/swagger-scala-module"))
1515

16+
autoAPIMappings := true
17+
18+
apiMappings ++= {
19+
def mappingsFor(organization: String, names: List[String], location: String, revision: (String) => String = identity): Seq[(File, URL)] =
20+
for {
21+
entry: Attributed[File] <- (Compile / fullClasspath).value
22+
module: ModuleID <- entry.get(moduleID.key)
23+
if module.organization == organization
24+
if names.exists(module.name.startsWith)
25+
} yield entry.data -> url(location.format(revision(module.revision)))
26+
27+
val mappings: Seq[(File, URL)] =
28+
mappingsFor("org.scala-lang", List("scala-library"), "https://scala-lang.org/api/%s/") ++
29+
mappingsFor("io.swagger.core.v3", List("swagger-core-jakarta"), "https://javadoc.io/doc/io.swagger.core.v3/swagger-core") ++
30+
mappingsFor("com.fasterxml.jackson.core", List("jackson-core"), "https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-core/%s/") ++
31+
mappingsFor("com.fasterxml.jackson.core", List("jackson-databind"), "https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-databind/%s/")
32+
33+
mappings.toMap
34+
}
35+
1636
val scalaReleaseVersion = SettingKey[Int]("scalaReleaseVersion")
1737
scalaReleaseVersion := {
1838
val v = scalaVersion.value

0 commit comments

Comments
 (0)