diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2023-07-05 10:04:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-05 10:04:55 +0200 |
commit | 9559158bfeeb274e9ccf1b4563f1b23b42afc493 (patch) | |
tree | 3ece0887623cfe2b7148af23001867a1dd5e6597 /plugins/kotlin-as-java/src/main/kotlin/transformToJava.kt | |
parent | cbd9733d3dd2f52992e98e7cebd072091a572529 (diff) | |
download | dokka-9559158bfeeb274e9ccf1b4563f1b23b42afc493.tar.gz dokka-9559158bfeeb274e9ccf1b4563f1b23b42afc493.tar.bz2 dokka-9559158bfeeb274e9ccf1b4563f1b23b42afc493.zip |
Decompose Kotlin/Java analysis (#3034)
* Extract analysis into separate modules
Diffstat (limited to 'plugins/kotlin-as-java/src/main/kotlin/transformToJava.kt')
-rw-r--r-- | plugins/kotlin-as-java/src/main/kotlin/transformToJava.kt | 19 |
1 files changed, 14 insertions, 5 deletions
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<DFunction> { - 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) + } } |