diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2023-05-30 20:28:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-30 20:28:44 +0200 |
commit | 202fa09316fb1e0ff586c0d2301f99284fc74d9a (patch) | |
tree | 875752dd4c6d7b75826406bc6d9c6d1c03d9f1fa /runners/gradle-plugin/src/main/kotlin | |
parent | f182a0add34876f74c47100e604f79f46c4ddca2 (diff) | |
download | dokka-202fa09316fb1e0ff586c0d2301f99284fc74d9a.tar.gz dokka-202fa09316fb1e0ff586c0d2301f99284fc74d9a.tar.bz2 dokka-202fa09316fb1e0ff586c0d2301f99284fc74d9a.zip |
Add the ability to get serialized configuration of a task (#3008)
Diffstat (limited to 'runners/gradle-plugin/src/main/kotlin')
-rw-r--r-- | runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/internal/AbstractDokkaTaskExtensions.kt | 24 |
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() + } +} |