Make unidoc generate external javadoc links (#477)
* make unidoc generate external javadoc links (#353) * Move code of updating apiMappings
This commit is contained in:
parent
17403a4faa
commit
2b2d325006
1 changed files with 18 additions and 0 deletions
|
|
@ -156,6 +156,24 @@ object UnidocRoot extends AutoPlugin {
|
|||
Seq(
|
||||
ScalaUnidoc / unidocProjectFilter := unidocRootProjectFilter(unidocRootIgnoreProjects.value),
|
||||
JavaUnidoc / unidocProjectFilter := unidocRootProjectFilter(unidocRootIgnoreProjects.value),
|
||||
Compile / doc / apiMappings ++= {
|
||||
val entries: Seq[Attributed[File]] = (LocalProject("slf4j") / Compile / fullClasspath).value
|
||||
|
||||
def mappingsFor(organization: String, names: List[String], location: String,
|
||||
revision: String => String = identity): Seq[(File, URL)] = {
|
||||
for {
|
||||
entry: Attributed[File] <- entries
|
||||
module: ModuleID <- entry.get(moduleID.key)
|
||||
if module.organization == organization
|
||||
if names.exists(module.name.startsWith)
|
||||
} yield entry.data -> url(location.format(module.revision))
|
||||
}
|
||||
|
||||
val mappings: Seq[(File, URL)] =
|
||||
mappingsFor("org.slf4j", List("slf4j-api"), "https://www.javadoc.io/doc/org.slf4j/slf4j-api/%s/")
|
||||
|
||||
mappings.toMap
|
||||
},
|
||||
ScalaUnidoc / apiMappings := (Compile / doc / apiMappings).value) ++
|
||||
UnidocRoot.CliOptions.genjavadocEnabled
|
||||
.ifTrue(Seq(JavaUnidoc / unidocAllSources ~= { v =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue