Skip to content

Commit

Permalink
Add the ability to get serialized configuration of a task (#3008)
Browse files Browse the repository at this point in the history
(cherry picked from commit 202fa09)
  • Loading branch information
IgnatBeresnev committed Jun 1, 2023
1 parent b6ee078 commit e3c383c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions runners/gradle-plugin/api/gradle-plugin.api
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
}
}

0 comments on commit e3c383c

Please sign in to comment.