diff options
Diffstat (limited to 'plugins/base/src/main/kotlin/resolvers/local')
3 files changed, 11 insertions, 15 deletions
diff --git a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt index a9e58f17..eada2e3b 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt @@ -1,16 +1,14 @@ package org.jetbrains.dokka.base.resolvers.local import org.jetbrains.dokka.DokkaConfiguration +import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.resolvers.external.ExternalLocationProvider import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.model.SourceSetData -import org.jetbrains.dokka.model.sourceSet import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.plugin import org.jetbrains.dokka.plugability.query -import java.lang.IllegalStateException import java.net.HttpURLConnection import java.net.URL import java.net.URLConnection @@ -48,14 +46,12 @@ open class DefaultLocationProvider( override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean): String = pathTo(node, context) + if (!skipExtension) extension else "" - override fun resolve(dri: DRI, sourceSets: List<SourceSetData>, context: PageNode?): String = + override fun resolve(dri: DRI, sourceSets: List<DokkaSourceSet>, context: PageNode?): String = pagesIndex[dri]?.let { resolve(it, context) } ?: // Not found in PageGraph, that means it's an external link - getLocation(dri, - this.dokkaContext.configuration.passesConfigurations - .filter { passConfig -> - sourceSets.toSet().contains(dokkaContext.sourceSet(passConfig)) - } + getLocation( + dri, + sourceSets .groupBy({ it.jdkVersion }, { it.externalDocumentationLinks }) .map { it.key to it.value.flatten().distinct() }.toMap() ) @@ -105,7 +101,7 @@ open class DefaultLocationProvider( // Not in cache, resolve packageLists for ((jdk, links) in toResolve) { for (link in links) { - if(dokkaContext.configuration.offlineMode && link.packageListUrl.protocol.toLowerCase() != "file") + if (dokkaContext.configuration.offlineMode && link.packageListUrl.protocol.toLowerCase() != "file") continue val locationInfo = loadPackageList(jdk, link.packageListUrl) diff --git a/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt index c6c48d63..d6d616f3 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt @@ -1,12 +1,12 @@ package org.jetbrains.dokka.base.resolvers.local import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.model.SourceSetData +import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.pages.PageNode import org.jetbrains.dokka.pages.RootPageNode interface LocationProvider { - fun resolve(dri: DRI, sourceSets: List<SourceSetData>, context: PageNode? = null): String + fun resolve(dri: DRI, sourceSets: List<DokkaSourceSet>, context: PageNode? = null): String fun resolve(node: PageNode, context: PageNode? = null, skipExtension: Boolean = false): String fun resolveRoot(node: PageNode): String fun ancestors(node: PageNode): List<PageNode> diff --git a/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt index 21692bf9..39b005a1 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt @@ -1,7 +1,7 @@ package org.jetbrains.dokka.base.resolvers.local import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.model.SourceSetData +import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.pages.PageNode import org.jetbrains.dokka.pages.RootPageNode import org.jetbrains.dokka.plugability.DokkaContext @@ -14,10 +14,10 @@ class MultimoduleLocationProvider(private val root: RootPageNode, context: Dokka it.name to it.path }.toMap() - override fun resolve(dri: DRI, platforms: List<SourceSetData>, context: PageNode?): String = + override fun resolve(dri: DRI, sourceSets: List<DokkaSourceSet>, context: PageNode?): String = dri.takeIf { it.packageName == MULTIMODULE_PACKAGE_PLACEHOLDER }?.classNames?.let { paths[it] }?.let { "$it/${dri.classNames}/index.html" - } ?: defaultLocationProvider.resolve(dri, platforms, context) + } ?: defaultLocationProvider.resolve(dri, sourceSets, context) override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean): String = defaultLocationProvider.resolve(node, context, skipExtension) |