aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Generation
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-09-24 21:53:00 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-09-24 21:53:00 +0300
commit3617e8c0962e32201605c154c5360c1e5defab12 (patch)
treef69e4fa055b6d02f5406b4df23d49c11067d1e61 /core/src/main/kotlin/Generation
parent49b7b776757113139fb7aed9c8959276d844b09b (diff)
downloaddokka-3617e8c0962e32201605c154c5360c1e5defab12.tar.gz
dokka-3617e8c0962e32201605c154c5360c1e5defab12.tar.bz2
dokka-3617e8c0962e32201605c154c5360c1e5defab12.zip
Use only first target for expect elements
Diffstat (limited to 'core/src/main/kotlin/Generation')
-rw-r--r--core/src/main/kotlin/Generation/DokkaGenerator.kt10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/src/main/kotlin/Generation/DokkaGenerator.kt b/core/src/main/kotlin/Generation/DokkaGenerator.kt
index 9d718971..9173dfbb 100644
--- a/core/src/main/kotlin/Generation/DokkaGenerator.kt
+++ b/core/src/main/kotlin/Generation/DokkaGenerator.kt
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.cli.jvm.config.JavaSourceRoot
import org.jetbrains.kotlin.config.JVMConfigurationKeys
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
+import org.jetbrains.kotlin.descriptors.MemberDescriptor
import org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer
import org.jetbrains.kotlin.resolve.TopDownAnalysisMode
import org.jetbrains.kotlin.utils.PathUtil
@@ -73,9 +74,12 @@ class DokkaGenerator(val dokkaConfiguration: DokkaConfiguration,
val defaultPlatformAsList = passConfiguration.targets
val defaultPlatformsProvider = object : DefaultPlatformsProvider {
override fun getDefaultPlatforms(descriptor: DeclarationDescriptor): List<String> {
- val containingFilePath = descriptor.sourcePsi()?.containingFile?.virtualFile?.canonicalPath
- ?.let { File(it).absolutePath }
- val sourceRoot = containingFilePath?.let { path -> sourceRoots.find { path.startsWith(it.path) } }
+// val containingFilePath = descriptor.sourcePsi()?.containingFile?.virtualFile?.canonicalPath
+// ?.let { File(it).absolutePath }
+// val sourceRoot = containingFilePath?.let { path -> sourceRoots.find { path.startsWith(it.path) } }
+ if (descriptor is MemberDescriptor && descriptor.isExpect) {
+ return defaultPlatformAsList.take(1)
+ }
return /*sourceRoot?.platforms ?: */defaultPlatformAsList
}
}