aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/DokkaGenerator.kt
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-06-19 14:08:49 +0200
committerPaweł Marks <pmarks@virtuslab.com>2020-06-25 20:23:58 +0200
commit8cb6efc97f8fa321381c95cc5f85a3ce7bc13c3f (patch)
treefe4e24d9f352199e551bd34ba330c0d2c0acf7af /core/src/main/kotlin/DokkaGenerator.kt
parent08f40e2a13006882e8f8425f111b8527e7bbcb0f (diff)
downloaddokka-8cb6efc97f8fa321381c95cc5f85a3ce7bc13c3f.tar.gz
dokka-8cb6efc97f8fa321381c95cc5f85a3ce7bc13c3f.tar.bz2
dokka-8cb6efc97f8fa321381c95cc5f85a3ce7bc13c3f.zip
Remove SourceSetDataCache, rename PassConfiguration to DokkaSourceSet and use it instead of SourceSetData
Diffstat (limited to 'core/src/main/kotlin/DokkaGenerator.kt')
-rw-r--r--core/src/main/kotlin/DokkaGenerator.kt25
1 files changed, 9 insertions, 16 deletions
diff --git a/core/src/main/kotlin/DokkaGenerator.kt b/core/src/main/kotlin/DokkaGenerator.kt
index b88c6223..ce8d229a 100644
--- a/core/src/main/kotlin/DokkaGenerator.kt
+++ b/core/src/main/kotlin/DokkaGenerator.kt
@@ -1,8 +1,7 @@
package org.jetbrains.dokka
import org.jetbrains.dokka.model.DModule
-import org.jetbrains.dokka.model.SourceSetCache
-import org.jetbrains.dokka.model.SourceSetData
+import org.jetbrains.dokka.DokkaConfiguration.*
import org.jetbrains.dokka.pages.RootPageNode
import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.plugability.DokkaPlugin
@@ -18,13 +17,11 @@ class DokkaGenerator(
private val logger: DokkaLogger
) {
fun generate() = timed {
- val sourceSetsCache = SourceSetCache()
-
report("Initializing plugins")
- val context = initializePlugins(configuration, logger, sourceSetsCache)
+ val context = initializePlugins(configuration, logger)
report("Creating documentation models")
- val modulesFromPlatforms = createDocumentationModels(context, sourceSetsCache)
+ val modulesFromPlatforms = createDocumentationModels(context)
report("Transforming documentation model before merging")
val transformedDocumentationBeforeMerge = transformDocumentationModelBeforeMerge(modulesFromPlatforms, context)
@@ -48,9 +45,8 @@ class DokkaGenerator(
}.dump("\n\n === TIME MEASUREMENT ===\n")
fun generateAllModulesPage() = timed {
- val sourceSetsCache = SourceSetCache()
report("Initializing plugins")
- val context = initializePlugins(configuration, logger, sourceSetsCache)
+ val context = initializePlugins(configuration, logger)
report("Creating all modules page")
val pages = createAllModulePage(context)
@@ -66,15 +62,12 @@ class DokkaGenerator(
fun initializePlugins(
configuration: DokkaConfiguration,
logger: DokkaLogger,
- sourceSetsCache: SourceSetCache,
pluginOverrides: List<DokkaPlugin> = emptyList()
- ) = DokkaContext.create(configuration, logger, sourceSetsCache, pluginOverrides)
+ ) = DokkaContext.create(configuration, logger, pluginOverrides)
fun createDocumentationModels(
- context: DokkaContext,
- sourceSetsCache: SourceSetCache
- ) = context.configuration.passesConfigurations
- .map { passConfiguration -> sourceSetsCache.getSourceSet(passConfiguration) }
+ context: DokkaContext
+ ) = context.configuration.sourceSets
.flatMap { passConfiguration -> translateSources(passConfiguration, context) }
fun transformDocumentationModelBeforeMerge(
@@ -133,9 +126,9 @@ class DokkaGenerator(
}
}
- private fun translateSources(platformData: SourceSetData, context: DokkaContext) =
+ private fun translateSources(sourceSet: DokkaSourceSet, context: DokkaContext) =
context[CoreExtensions.sourceToDocumentableTranslator].map {
- it.invoke(platformData, context)
+ it.invoke(sourceSet, context)
}
}