aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin/src
diff options
context:
space:
mode:
Diffstat (limited to 'runners/gradle-plugin/src')
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/internal/AbstractDokkaTaskExtensions.kt24
1 files changed, 24 insertions, 0 deletions
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 00000000..ba1f4505
--- /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()
+ }
+}