aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/resolvers
diff options
context:
space:
mode:
authorAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2019-12-13 14:27:25 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-01-16 11:55:53 +0100
commit0917459a2eafabc563e79579a0322bb7832cae1f (patch)
treea5ac67c7595232a28af27716711bee644d3a12f3 /core/src/main/kotlin/resolvers
parent9e69d2db272b2ebe9317b88ce222473c4df355af (diff)
downloaddokka-0917459a2eafabc563e79579a0322bb7832cae1f.tar.gz
dokka-0917459a2eafabc563e79579a0322bb7832cae1f.tar.bz2
dokka-0917459a2eafabc563e79579a0322bb7832cae1f.zip
Refactor of DokkaGenerator pipeline, removed ExtensionPoints dependencies other than context
Diffstat (limited to 'core/src/main/kotlin/resolvers')
-rw-r--r--core/src/main/kotlin/resolvers/DefaultLocationProvider.kt5
-rw-r--r--core/src/main/kotlin/resolvers/LocationProviderFactory.kt13
2 files changed, 15 insertions, 3 deletions
diff --git a/core/src/main/kotlin/resolvers/DefaultLocationProvider.kt b/core/src/main/kotlin/resolvers/DefaultLocationProvider.kt
index 7442f449..7eae26ca 100644
--- a/core/src/main/kotlin/resolvers/DefaultLocationProvider.kt
+++ b/core/src/main/kotlin/resolvers/DefaultLocationProvider.kt
@@ -10,8 +10,7 @@ import org.jetbrains.dokka.plugability.single
open class DefaultLocationProvider(
private val pageGraphRoot: ModulePageNode,
- private val configuration: DokkaConfiguration,
- context: DokkaContext
+ private val context: DokkaContext
) : LocationProvider { // TODO: cache
private val extension = context.single(CoreExtensions.fileExtension)
@@ -21,7 +20,7 @@ open class DefaultLocationProvider(
findInPageGraph(dri, platforms)?.let { resolve(it, context) } ?:
// Not found in PageGraph, that means it's an external link
ExternalLocationProvider.getLocation(dri,
- configuration.passesConfigurations
+ this@DefaultLocationProvider.context.configuration.passesConfigurations
.filter { passConfig ->
platforms.toSet().contains(PlatformData(passConfig.moduleName, passConfig.analysisPlatform, passConfig.targets))
} // TODO: change targets to something better?
diff --git a/core/src/main/kotlin/resolvers/LocationProviderFactory.kt b/core/src/main/kotlin/resolvers/LocationProviderFactory.kt
new file mode 100644
index 00000000..1622045b
--- /dev/null
+++ b/core/src/main/kotlin/resolvers/LocationProviderFactory.kt
@@ -0,0 +1,13 @@
+package org.jetbrains.dokka.resolvers
+
+import org.jetbrains.dokka.pages.ModulePageNode
+import org.jetbrains.dokka.pages.PageNode
+import org.jetbrains.dokka.plugability.DokkaContext
+
+interface LocationProviderFactory {
+ fun getLocationProvider(pageNode: PageNode, context: DokkaContext): LocationProvider
+}
+
+object DefaultLocationProviderFactory : LocationProviderFactory {
+ override fun getLocationProvider(pageNode: PageNode, context: DokkaContext) = DefaultLocationProvider(pageNode as ModulePageNode, context)
+} \ No newline at end of file