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 | |
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')
-rw-r--r-- | runners/gradle-plugin/api/gradle-plugin.api | 5 | ||||
-rw-r--r-- | runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/internal/AbstractDokkaTaskExtensions.kt | 24 |
2 files changed, 29 insertions, 0 deletions
diff --git a/runners/gradle-plugin/api/gradle-plugin.api b/runners/gradle-plugin/api/gradle-plugin.api index b082f22b..d7d38d2f 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 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() + } +} |