aboutsummaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorSzymon Świstun <sswistun@virtuslab.com>2019-12-16 17:59:48 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-01-08 10:45:08 +0100
commitbe47aa9b85be2100204dcb740f8eea41489e67a9 (patch)
treea8170c350f186de0e96a52dca6f089340334e45d /core/src
parentf57e3081052d6d148b4f8af70f838ba13ae96b29 (diff)
downloaddokka-be47aa9b85be2100204dcb740f8eea41489e67a9.tar.gz
dokka-be47aa9b85be2100204dcb740f8eea41489e67a9.tar.bz2
dokka-be47aa9b85be2100204dcb740f8eea41489e67a9.zip
response to comments
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/kotlin/DokkaGenerator.kt8
-rw-r--r--core/src/main/kotlin/model/Documentable.kt2
-rw-r--r--core/src/main/kotlin/pages/PageNodes.kt2
-rw-r--r--core/src/main/kotlin/parsers/MarkdownParser.kt3
-rw-r--r--core/src/main/kotlin/resolvers/DefaultLocationProvider.kt2
5 files changed, 9 insertions, 8 deletions
diff --git a/core/src/main/kotlin/DokkaGenerator.kt b/core/src/main/kotlin/DokkaGenerator.kt
index cabe43b6..b4035617 100644
--- a/core/src/main/kotlin/DokkaGenerator.kt
+++ b/core/src/main/kotlin/DokkaGenerator.kt
@@ -24,14 +24,14 @@ class DokkaGenerator(
fun generate() {
logger.debug("Setting up analysis environments")
val platforms: Map<PlatformData, EnvironmentAndFacade> = configuration.passesConfigurations.map {
- PlatformData(it.analysisPlatform, it.targets) to createEnvironmentAndFacade(it)
+ PlatformData(it.moduleName, it.analysisPlatform, it.targets) to createEnvironmentAndFacade(it)
}.toMap()
logger.debug("Initializing plugins")
val context = DokkaContext.create(configuration.pluginsClasspath, logger, platforms)
logger.debug("Creating documentation models")
- val modulesFromPlatforms = platforms.map { (pdata, _) -> translateDescriptors(configuration.passesConfigurations.first().moduleName, pdata, context) }
+ val modulesFromPlatforms = platforms.map { (pdata, _) -> translateDescriptors(pdata, context) }
logger.debug("Merging documentation models")
val documentationModel = context.single(CoreExtensions.documentationMerger)
@@ -75,7 +75,7 @@ class DokkaGenerator(
EnvironmentAndFacade(environment, facade)
}
- private fun translateDescriptors(moduleName: String, platformData: PlatformData, context: DokkaContext): Module {
+ private fun translateDescriptors(platformData: PlatformData, context: DokkaContext): Module {
val (environment, facade) = context.platforms.getValue(platformData)
val packageFragments = environment.getSourceFiles().asSequence()
@@ -85,7 +85,7 @@ class DokkaGenerator(
.toList()
return context.single(CoreExtensions.descriptorToDocumentationTranslator)
- .invoke(moduleName, packageFragments, platformData, context)
+ .invoke(platformData.name, packageFragments, platformData, context)
}
private class DokkaMessageCollector(private val logger: DokkaLogger) : MessageCollector {
diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt
index bd3dafda..ac0b41d9 100644
--- a/core/src/main/kotlin/model/Documentable.kt
+++ b/core/src/main/kotlin/model/Documentable.kt
@@ -5,7 +5,7 @@ import org.jetbrains.dokka.transformers.descriptors.KotlinTypeWrapper
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.pages.PlatformData
-class Module(override val name: String?, val packages: List<Package>) : Documentable() {
+class Module(override val name: String, val packages: List<Package>) : Documentable() {
override val dri: DRI = DRI.topLevel
override val children: List<Package> = packages
override val extra: MutableSet<Extra> = mutableSetOf()
diff --git a/core/src/main/kotlin/pages/PageNodes.kt b/core/src/main/kotlin/pages/PageNodes.kt
index 0aa439de..9274ac2b 100644
--- a/core/src/main/kotlin/pages/PageNodes.kt
+++ b/core/src/main/kotlin/pages/PageNodes.kt
@@ -119,7 +119,7 @@ class MemberPageNode(
else MemberPageNode(name, content, dri, documentable, children, embeddedResources)
}
-data class PlatformData(val platformType: Platform, val targets: List<String>) {
+data class PlatformData(val name: String, val platformType: Platform, val targets: List<String>) {
override fun toString() = targets.toString()
}
diff --git a/core/src/main/kotlin/parsers/MarkdownParser.kt b/core/src/main/kotlin/parsers/MarkdownParser.kt
index 735f90d5..5e4b82e8 100644
--- a/core/src/main/kotlin/parsers/MarkdownParser.kt
+++ b/core/src/main/kotlin/parsers/MarkdownParser.kt
@@ -10,6 +10,7 @@ import org.intellij.markdown.flavours.commonmark.CommonMarkFlavourDescriptor
import org.jetbrains.dokka.analysis.DokkaResolutionFacade
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.parsers.factories.DocNodesFromIElementFactory
+import org.jetbrains.dokka.utilities.DokkaConsoleLogger
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.idea.kdoc.resolveKDocLink
import org.jetbrains.kotlin.kdoc.parser.KDocKnownTag
@@ -91,7 +92,7 @@ class MarkdownParser (
declarationDescriptor,
null,
link.split('.')
- ).also { if (it.size > 1) println("Markdown link resolved more than one element: $it") }.firstOrNull()//.single()
+ ).also { if (it.size > 1) DokkaConsoleLogger.warn("Markdown link resolved more than one element: $it") }.firstOrNull()//.single()
?.let { DRI.from(it) }
}
diff --git a/core/src/main/kotlin/resolvers/DefaultLocationProvider.kt b/core/src/main/kotlin/resolvers/DefaultLocationProvider.kt
index fb9ac6cd..99c7f986 100644
--- a/core/src/main/kotlin/resolvers/DefaultLocationProvider.kt
+++ b/core/src/main/kotlin/resolvers/DefaultLocationProvider.kt
@@ -23,7 +23,7 @@ open class DefaultLocationProvider(
ExternalLocationProvider.getLocation(dri,
configuration.passesConfigurations
.filter { passConfig ->
- platforms.toSet().contains(PlatformData(passConfig.analysisPlatform, passConfig.targets))
+ platforms.toSet().contains(PlatformData(passConfig.moduleName, passConfig.analysisPlatform, passConfig.targets))
} // TODO: change targets to something better?
.flatMap { it.externalDocumentationLinks }.distinct()
)