diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-11-27 16:52:18 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-11-27 16:52:18 +0000 |
commit | e82fc6bbd514014a46be9044296ebec4b67901e9 (patch) | |
tree | 4058cd853f36166d424eee7e69e95ad3125d1189 | |
parent | b62fcf9d6d2ac727fbd90f1ca9533edd8aea4dcf (diff) | |
parent | 77665b03848c6574ff3e40ec875c347d5eb41a8f (diff) | |
download | dokka-androidx-media2-release.tar.gz |
Snap for 11144667 from 77665b03848c6574ff3e40ec875c347d5eb41a8f to androidx-media2-releaseandroidx-media2-release
Change-Id: I9747bffe65d953acc68b1708cfca7d4214518000
6 files changed, 43 insertions, 7 deletions
diff --git a/Android.bp b/Android.bp index ba7933be7..dbfdb5030 100644 --- a/Android.bp +++ b/Android.bp @@ -50,7 +50,6 @@ java_binary_host { // (it references packages under com.sun.tools.doclets which are not // exported from the jdk.javadoc module) (see b/140097603): java_version: "1.8", - kotlincflags: ["-language-version 1.3 -api-version 1.3 -jvm-target 1.8"], use_tools_jar: true, java_resource_dirs: ["core/src/main/resources"], } diff --git a/core/src/main/kotlin/Formats/JavaLayoutHtml/JavaLayoutHtmlFormatOutputBuilder.kt b/core/src/main/kotlin/Formats/JavaLayoutHtml/JavaLayoutHtmlFormatOutputBuilder.kt index 2711a2df9..59d898a2a 100644 --- a/core/src/main/kotlin/Formats/JavaLayoutHtml/JavaLayoutHtmlFormatOutputBuilder.kt +++ b/core/src/main/kotlin/Formats/JavaLayoutHtml/JavaLayoutHtmlFormatOutputBuilder.kt @@ -857,19 +857,31 @@ open class JavaLayoutHtmlFormatOutputBuilder( protected open fun FlowContent.apiAndDeprecatedVersions(node: DocumentationNode) { val apiLevelExists = node.apiLevel.name.isNotEmpty() + val sdkExtSinceExists = node.sdkExtSince.name.isNotEmpty() val deprecatedLevelExists = node.deprecatedLevel.name.isNotEmpty() - if (apiLevelExists || deprecatedLevelExists) { + if (apiLevelExists || sdkExtSinceExists || deprecatedLevelExists) { div(classes = "api-level") { if (apiLevelExists) { +"Added in " a(href = "https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels") { +"API level ${node.apiLevel.name}" } - if (deprecatedLevelExists) { + } + if (sdkExtSinceExists) { + if (apiLevelExists) { br + +"Also in " + } else { + +"Added in " + } + a(href = "https://developer.android.com/sdkExtensions") { + +"${node.sdkExtSince.name}" } } if (deprecatedLevelExists) { + if (apiLevelExists || sdkExtSinceExists) { + br + } +"Deprecated in " a(href = "https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels") { +"API level ${node.deprecatedLevel.name}" @@ -1056,7 +1068,7 @@ open class JavaLayoutHtmlFormatOutputBuilder( val inheritedFieldsByReceiver = allInheritedMembers.filter { - it == NodeKind.Field && it.constantValue() != null + it.kind == NodeKind.Field && it.constantValue() != null }.groupBy { it.owner!! } val originalExtensions = if (!isCompanion) node.extensions else node.owner!!.extensions @@ -1156,4 +1168,4 @@ fun DocumentationNode.constantValue(): String? = private val visibilityNames = setOf("public", "protected", "internal", "package-local", "private") fun DocumentationNode.visibility(): String = - details(NodeKind.Modifier).firstOrNull { it.name in visibilityNames }?.name ?: ""
\ No newline at end of file + details(NodeKind.Modifier).firstOrNull { it.name in visibilityNames }?.name ?: "" diff --git a/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt b/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt index a7df4e482..94bb0455d 100644 --- a/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt +++ b/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt @@ -112,7 +112,7 @@ class JavaPsiDocumentationBuilder : JavaDocumentationBuilder { fun nodeForElement(element: PsiNamedElement, kind: NodeKind, name: String = element.name ?: "<anonymous>"): DocumentationNode { - val (docComment, deprecatedContent, attrs, apiLevel, deprecatedLevel, artifactId, attribute) = docParser.parseDocumentation(element) + val (docComment, deprecatedContent, attrs, apiLevel, sdkExtSince, deprecatedLevel, artifactId, attribute) = docParser.parseDocumentation(element) val node = DocumentationNode(name, docComment, kind) if (element is PsiModifierListOwner) { node.appendModifiers(element) @@ -140,6 +140,9 @@ class JavaPsiDocumentationBuilder : JavaDocumentationBuilder { apiLevel?.let { node.append(it, RefKind.Detail) } + sdkExtSince?.let { + node.append(it, RefKind.Detail) + } deprecatedLevel?.let { node.append(it, RefKind.Detail) } diff --git a/core/src/main/kotlin/Java/JavadocParser.kt b/core/src/main/kotlin/Java/JavadocParser.kt index 21cc2bbdf..0c73e7661 100644 --- a/core/src/main/kotlin/Java/JavadocParser.kt +++ b/core/src/main/kotlin/Java/JavadocParser.kt @@ -25,6 +25,7 @@ data class JavadocParseResult( val deprecatedContent: Content?, val attributeRefs: List<String>, val apiLevel: DocumentationNode? = null, + val sdkExtSince: DocumentationNode? = null, val deprecatedLevel: DocumentationNode? = null, val artifactId: DocumentationNode? = null, val attribute: DocumentationNode? = null @@ -35,6 +36,7 @@ data class JavadocParseResult( emptyList(), null, null, + null, null ) } @@ -109,6 +111,7 @@ class JavadocParser( val attrRefSignatures = mutableListOf<String>() var since: DocumentationNode? = null + var sdkextsince: DocumentationNode? = null var deprecated: DocumentationNode? = null var artifactId: DocumentationNode? = null var attrName: String? = null @@ -135,6 +138,9 @@ class JavadocParser( "since", "apisince" -> { since = DocumentationNode(tag.getApiLevel() ?: "", Content.Empty, NodeKind.ApiLevel) } + "sdkextsince" -> { + sdkextsince = DocumentationNode(tag.getSdkExtSince() ?: "", Content.Empty, NodeKind.SdkExtSince) + } "deprecatedsince" -> { deprecated = DocumentationNode(tag.getApiLevel() ?: "", Content.Empty, NodeKind.DeprecatedLevel) } @@ -153,7 +159,7 @@ class JavadocParser( attrName?.let { name -> attr = DocumentationNode(name, attrDesc ?: Content.Empty, NodeKind.AttributeRef) } - return JavadocParseResult(result, deprecatedContent, attrRefSignatures, since, deprecated, artifactId, attr) + return JavadocParseResult(result, deprecatedContent, attrRefSignatures, since, sdkextsince, deprecated, artifactId, attr) } private val tagsToInherit = setOf("param", "return", "throws") @@ -182,6 +188,13 @@ class JavadocParser( return null } + fun PsiDocTag.getSdkExtSince(): String? { + if (dataElements.isNotEmpty()) { + return join(dataElements.map { it.text }, " ") + } + return null + } + private fun PsiDocTag.getAttrRef(element: PsiNamedElement): String? { if (dataElements.size > 1) { val elementText = dataElements[1].text 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) } diff --git a/core/src/main/kotlin/Model/DocumentationNode.kt b/core/src/main/kotlin/Model/DocumentationNode.kt index c84d4169d..7ac6d8f4a 100644 --- a/core/src/main/kotlin/Model/DocumentationNode.kt +++ b/core/src/main/kotlin/Model/DocumentationNode.kt @@ -64,6 +64,7 @@ enum class NodeKind { AttributeRef, ApiLevel, + SdkExtSince, DeprecatedLevel, @@ -120,6 +121,8 @@ open class DocumentationNode(val name: String, get() = references(RefKind.ExternalType).map { it.to }.firstOrNull() val apiLevel: DocumentationNode get() = detailOrNull(NodeKind.ApiLevel) ?: DocumentationNode("", Content.Empty, NodeKind.ApiLevel) + val sdkExtSince: DocumentationNode + get() = detailOrNull(NodeKind.SdkExtSince) ?: DocumentationNode("", Content.Empty, NodeKind.SdkExtSince) val deprecatedLevel: DocumentationNode get() = detailOrNull(NodeKind.DeprecatedLevel) ?: DocumentationNode("", Content.Empty, NodeKind.DeprecatedLevel) val artifactId: DocumentationNode |