From eed6dd88004992da4c3545b756c23b4e62e54043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Kongstad?= Date: Mon, 5 Dec 2022 14:55:41 +0100 Subject: Add support for "Added in " Teach Dokka to parse @sdkExtSince javadoc comments. These comments are equivalent to @apiSince, but for SDK extensions. Because symbols can be finalized in an Android dessert (@apiSince), an SDK extensions (@sdkExtSince) or both (@apiSince + @sdkExtSince), Dokka will emit one of the following snippets: - Added in API level - Added in - Added in API level Also in Bug: 261168446 Test: m ds-docs-kt # and manually inspect out/target/common/docs/ds-docs-kt-docs.zip Change-Id: Ia207d1284cda84ae612a955edfc67aecc75ac462 --- core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt') diff --git a/core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt b/core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt index 6841503fc..098a17f97 100644 --- a/core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt +++ b/core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt @@ -142,6 +142,9 @@ class DescriptorDocumentationParser @Inject constructor( } else if (name?.toLowerCase() == "since" || name?.toLowerCase() == "apisince") { val apiLevel = DocumentationNode(it.getContent(), Content.Empty, NodeKind.ApiLevel) append(apiLevel, RefKind.Detail) + } else if (name?.toLowerCase() == "sdkextsince") { + val sdkExtSince = DocumentationNode(it.getContent(), Content.Empty, NodeKind.SdkExtSince) + append(sdkExtSince, RefKind.Detail) } else if (name?.toLowerCase() == "deprecatedsince") { val deprecatedLevel = DocumentationNode(it.getContent(), Content.Empty, NodeKind.DeprecatedLevel) append(deprecatedLevel, RefKind.Detail) @@ -223,6 +226,9 @@ class DescriptorDocumentationParser @Inject constructor( parseResult.apiLevel?.let { node.append(it, RefKind.Detail) } + parseResult.sdkExtSince?.let { + node.append(it, RefKind.Detail) + } parseResult.deprecatedLevel?.let { node.append(it, RefKind.Detail) } -- cgit v1.2.3