diff --git a/examples/gradle-v2/custom-dokka-plugin-example/demo-library/build.gradle.kts b/examples/gradle-v2/custom-dokka-plugin-example/demo-library/build.gradle.kts index 33d4bd4001..8e07785fd6 100644 --- a/examples/gradle-v2/custom-dokka-plugin-example/demo-library/build.gradle.kts +++ b/examples/gradle-v2/custom-dokka-plugin-example/demo-library/build.gradle.kts @@ -33,7 +33,7 @@ dokka { @OptIn(DokkaInternalApi::class) abstract class HideInternalApiParameters @Inject constructor( name: String -) : DokkaPluginParametersBaseSpec(name, "demo.dokka.plugin.ogp.HideInternalApiPlugin") { +) : DokkaPluginParametersBaseSpec(name, "demo.dokka.plugin.HideInternalApiPlugin") { @get:Input @get:Optional diff --git a/examples/gradle-v2/custom-dokka-plugin-example/dokka-plugin-hide-internal-api/src/main/kotlin/demo/dokka/plugin/ogp/HideInternalApiPlugin.kt b/examples/gradle-v2/custom-dokka-plugin-example/dokka-plugin-hide-internal-api/src/main/kotlin/demo/dokka/plugin/HideInternalApiPlugin.kt similarity index 83% rename from examples/gradle-v2/custom-dokka-plugin-example/dokka-plugin-hide-internal-api/src/main/kotlin/demo/dokka/plugin/ogp/HideInternalApiPlugin.kt rename to examples/gradle-v2/custom-dokka-plugin-example/dokka-plugin-hide-internal-api/src/main/kotlin/demo/dokka/plugin/HideInternalApiPlugin.kt index ab78900dc3..0b048d7c29 100644 --- a/examples/gradle-v2/custom-dokka-plugin-example/dokka-plugin-hide-internal-api/src/main/kotlin/demo/dokka/plugin/ogp/HideInternalApiPlugin.kt +++ b/examples/gradle-v2/custom-dokka-plugin-example/dokka-plugin-hide-internal-api/src/main/kotlin/demo/dokka/plugin/HideInternalApiPlugin.kt @@ -1,4 +1,8 @@ -package demo.dokka.plugin.ogp +/* + * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + +package demo.dokka.plugin import kotlinx.serialization.Serializable import kotlinx.serialization.json.Json @@ -23,10 +27,13 @@ class HideInternalApiPlugin : DokkaPlugin() { override fun pluginApiPreviewAcknowledgement() = PluginApiPreviewAcknowledgement companion object { - const val FQN = "demo.dokka.plugin.ogp.HideInternalApiPlugin" + const val FQN = "demo.dokka.plugin.HideInternalApiPlugin" } } +/** + * Configuration for [HideInternalApiPlugin]. + */ @Serializable data class HideInternalApiConfig( val annotatedWith: List @@ -34,13 +41,16 @@ data class HideInternalApiConfig( class HideInternalApiTransformer(context: DokkaContext) : SuppressedByConditionDocumentableFilterTransformer(context) { - private val configuration by lazy { + /** + * Decode [HideInternalApiPlugin] from the [DokkaContext]. + */ + private val configuration: HideInternalApiPlugin by lazy { val pluginConfig = context.configuration.pluginsConfiguration .firstOrNull { it.fqPluginName == HideInternalApiPlugin.FQN } if (pluginConfig != null) { require(pluginConfig.serializationFormat == DokkaConfiguration.SerializationFormat.JSON) { - "HideInternalApiPlugin requires configuration is encoded as JSON" + "HideInternalApiPlugin configuration must be encoded as JSON" } Json.decodeFromString(HideInternalApiConfig.serializer(), pluginConfig.values) diff --git a/examples/gradle-v2/custom-dokka-plugin-example/dokka-plugin-hide-internal-api/src/main/resources/META-INF/services/org.jetbrains.dokka.plugability.DokkaPlugin b/examples/gradle-v2/custom-dokka-plugin-example/dokka-plugin-hide-internal-api/src/main/resources/META-INF/services/org.jetbrains.dokka.plugability.DokkaPlugin index 2595ca8d8b..2b6715d7e7 100644 --- a/examples/gradle-v2/custom-dokka-plugin-example/dokka-plugin-hide-internal-api/src/main/resources/META-INF/services/org.jetbrains.dokka.plugability.DokkaPlugin +++ b/examples/gradle-v2/custom-dokka-plugin-example/dokka-plugin-hide-internal-api/src/main/resources/META-INF/services/org.jetbrains.dokka.plugability.DokkaPlugin @@ -1 +1 @@ -demo.dokka.plugin.ogp.HideInternalApiPlugin +demo.dokka.plugin.HideInternalApiPlugin