diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2017-02-24 11:56:23 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2017-02-24 11:56:23 +0100 |
commit | 77a3012145d04ff959de86fb5ec3845cde4b8167 (patch) | |
tree | a568ca0488f1f3dbb8af4dd686116746fb1cc846 /core/src | |
parent | bfd615dde13ef6ebbfaca6b042f263a57c11018c (diff) | |
download | dokka-77a3012145d04ff959de86fb5ec3845cde4b8167.tar.gz dokka-77a3012145d04ff959de86fb5ec3845cde4b8167.tar.bz2 dokka-77a3012145d04ff959de86fb5ec3845cde4b8167.zip |
Detect default platforms based only on the roots that we're currently processing
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/kotlin/Generation/DokkaGenerator.kt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/src/main/kotlin/Generation/DokkaGenerator.kt b/core/src/main/kotlin/Generation/DokkaGenerator.kt index b7163a5c..f014ec58 100644 --- a/core/src/main/kotlin/Generation/DokkaGenerator.kt +++ b/core/src/main/kotlin/Generation/DokkaGenerator.kt @@ -40,7 +40,7 @@ class DokkaGenerator(val logger: DokkaLogger, fun generate() { val sourcesGroupedByPlatform = sources.groupBy { it.defaultPlatforms[0] } for ((platform, roots) in sourcesGroupedByPlatform) { - appendSourceModule(platform, roots.map { it.path }) + appendSourceModule(platform, roots) } documentationModule.prepareForGeneration(options) @@ -52,7 +52,8 @@ class DokkaGenerator(val logger: DokkaLogger, logger.info("done in ${timeBuild / 1000} secs") } - private fun appendSourceModule(defaultPlatform: String, sourcePaths: List<String>) { + private fun appendSourceModule(defaultPlatform: String, sourceRoots: List<SourceRoot>) { + val sourcePaths = sourceRoots.map { it.path } val environment = createAnalysisEnvironment(sourcePaths) logger.info("Module: $moduleName") @@ -67,7 +68,7 @@ class DokkaGenerator(val logger: DokkaLogger, override fun getDefaultPlatforms(descriptor: DeclarationDescriptor): List<String> { val containingFilePath = descriptor.sourcePsi()?.containingFile?.virtualFile?.canonicalPath ?.let { File(it).absolutePath } - val sourceRoot = containingFilePath?.let { path -> sources.find { path.startsWith(it.path) } } + val sourceRoot = containingFilePath?.let { path -> sourceRoots.find { path.startsWith(it.path) } } return sourceRoot?.defaultPlatforms ?: listOf(defaultPlatform) } } |