From 9559158bfeeb274e9ccf1b4563f1b23b42afc493 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Wed, 5 Jul 2023 10:04:55 +0200 Subject: Decompose Kotlin/Java analysis (#3034) * Extract analysis into separate modules --- .../kotlin-as-java/src/main/kotlin/transformToJava.kt | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'plugins/kotlin-as-java/src/main/kotlin/transformToJava.kt') diff --git a/plugins/kotlin-as-java/src/main/kotlin/transformToJava.kt b/plugins/kotlin-as-java/src/main/kotlin/transformToJava.kt index 69df21ee..809f8a3c 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/transformToJava.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/transformToJava.kt @@ -1,6 +1,6 @@ package org.jetbrains.dokka.kotlinAsJava -import org.jetbrains.dokka.kotlinAsJava.converters.asJava +import org.jetbrains.dokka.kotlinAsJava.converters.KotlinToJavaConverter import org.jetbrains.dokka.kotlinAsJava.transformers.JvmNameDocumentableTransformer import org.jetbrains.dokka.model.DClasslike import org.jetbrains.dokka.model.DFunction @@ -13,17 +13,26 @@ private val JVM_NAME_DOCUMENTABLE_TRANSFORMER by lazy { } fun DPackage.transformToJava(context: DokkaContext): DPackage { - return JVM_NAME_DOCUMENTABLE_TRANSFORMER.transform(this.asJava(), context) + with(KotlinToJavaConverter(context)) { + return JVM_NAME_DOCUMENTABLE_TRANSFORMER.transform(this@transformToJava.asJava(), context) + } } fun DClasslike.transformToJava(context: DokkaContext): DClasslike { - return JVM_NAME_DOCUMENTABLE_TRANSFORMER.transform(this.asJava(), context) + with(KotlinToJavaConverter(context)) { + return JVM_NAME_DOCUMENTABLE_TRANSFORMER.transform(this@transformToJava.asJava(), context) + } } fun DFunction.transformToJava(context: DokkaContext, containingClassName: String, isTopLevel: Boolean = false): List { - return this.asJava(containingClassName, isTopLevel).map { JVM_NAME_DOCUMENTABLE_TRANSFORMER.transform(it, context) } + with(KotlinToJavaConverter(context)) { + return this@transformToJava.asJava(containingClassName, isTopLevel) + .map { JVM_NAME_DOCUMENTABLE_TRANSFORMER.transform(it, context) } + } } fun DProperty.transformToJava(context: DokkaContext, isTopLevel: Boolean = false, relocateToClass: String? = null): DProperty { - return JVM_NAME_DOCUMENTABLE_TRANSFORMER.transform(this.asJava(isTopLevel, relocateToClass), context) + with(KotlinToJavaConverter(context)) { + return JVM_NAME_DOCUMENTABLE_TRANSFORMER.transform(this@transformToJava.asJava(isTopLevel, relocateToClass), context) + } } -- cgit