diff --git a/runners/gradle-plugin/api/gradle-plugin.api b/runners/gradle-plugin/api/gradle-plugin.api index b082f22b86..d7d38d2f0d 100644 --- a/runners/gradle-plugin/api/gradle-plugin.api +++ b/runners/gradle-plugin/api/gradle-plugin.api @@ -174,6 +174,11 @@ public final class org/jetbrains/dokka/gradle/SourceSetKotlinGistConfigurationKt public static final fun configureWithKotlinSourceSet (Lorg/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder;Lorg/jetbrains/kotlin/gradle/plugin/KotlinSourceSet;)V } +public final class org/jetbrains/dokka/gradle/internal/AbstractDokkaTaskExtensionsKt { + public static final fun buildJsonConfiguration (Lorg/jetbrains/dokka/gradle/AbstractDokkaTask;Z)Ljava/lang/String; + public static synthetic fun buildJsonConfiguration$default (Lorg/jetbrains/dokka/gradle/AbstractDokkaTask;ZILjava/lang/Object;)Ljava/lang/String; +} + public final class org/jetbrains/dokka/gradle/kotlin/KotlinClasspathUtilsKt { public static final fun isHMPPEnabled (Lorg/gradle/api/Project;)Z } diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/internal/AbstractDokkaTaskExtensions.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/internal/AbstractDokkaTaskExtensions.kt new file mode 100644 index 0000000000..ba1f45055f --- /dev/null +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/internal/AbstractDokkaTaskExtensions.kt @@ -0,0 +1,24 @@ +package org.jetbrains.dokka.gradle.internal + +import org.jetbrains.dokka.InternalDokkaApi +import org.jetbrains.dokka.gradle.AbstractDokkaTask +import org.jetbrains.dokka.toPrettyJsonString +import org.jetbrains.dokka.DokkaConfiguration +import org.jetbrains.dokka.toCompactJsonString + +/** + * Serializes [DokkaConfiguration] of this [AbstractDokkaTask] as json + * + * Should be used for short-term debugging only, no guarantees are given for the support of this API. + * + * Better alternative should be introduced as part of [#2873](https://github.com/Kotlin/dokka/issues/2873). + */ +@InternalDokkaApi +fun AbstractDokkaTask.buildJsonConfiguration(prettyPrint: Boolean = true): String { + val configuration = this.buildDokkaConfiguration() + return if (prettyPrint) { + configuration.toPrettyJsonString() + } else { + configuration.toCompactJsonString() + } +}