diff options
author | Vadim Mishenev <vad-mishenev@yandex.ru> | 2023-05-17 21:07:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-17 21:07:19 +0300 |
commit | a9b3ee192ac09e2e1569a828a9da05d502fb2c75 (patch) | |
tree | dde2db404c95dd06176ce6cfebf5db131bd05538 /plugins/base | |
parent | 3fc8b83aa53a83e8e2915b22ff79acd6e6bb8d28 (diff) | |
download | dokka-a9b3ee192ac09e2e1569a828a9da05d502fb2c75.tar.gz dokka-a9b3ee192ac09e2e1569a828a9da05d502fb2c75.tar.bz2 dokka-a9b3ee192ac09e2e1569a828a9da05d502fb2c75.zip |
Update KGP to 1.8.20 (#2989)
* Update KGP to 1.8.20
* Update AGP to be compatible with KGP
* Replace `AndroidSourceSet`
* Dump API
* Update integration tests
* Update GH actions tests
* Refactor Gradle Runner
* Fix `TYPE_MISMATCH_WARNING_FOR_INCORRECT_CAPTURE_APPROXIMATION`
* Suppress source sets without compilations
Dokka suppresses source sets that do no have compilation since such configuration is invalid, it reports a warning or an error
* Introduce `dependsOn` for a new `com.android.build.api.dsl.AndroidSourceSet`
* API dump
* Add comment
* Suppress remaining `TYPE_MISMATCH_WARNING_FOR_INCORRECT_CAPTURE_APPROXIMATION`
* Add comment
---------
Co-authored-by: Ignat Beresnev <ignat.beresnev@jetbrains.com>
Diffstat (limited to 'plugins/base')
5 files changed, 11 insertions, 9 deletions
diff --git a/plugins/base/api/base.api b/plugins/base/api/base.api index 5e36f375..7875800e 100644 --- a/plugins/base/api/base.api +++ b/plugins/base/api/base.api @@ -1109,7 +1109,7 @@ public abstract class org/jetbrains/dokka/base/templating/SubstitutionCommand : public final class org/jetbrains/dokka/base/templating/TypeReference { public static final field Companion Lorg/jetbrains/dokka/base/templating/TypeReference$Companion; - public synthetic fun <init> (Lcom/fasterxml/jackson/core/type/TypeReference;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun <init> (Lcom/fasterxml/jackson/core/type/TypeReference;)V } public final class org/jetbrains/dokka/base/templating/TypeReference$Companion { diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt index 45a735c6..67e9407f 100644 --- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt +++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt @@ -102,9 +102,9 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog } } - private fun <T : DClasslike> classlikeSignature(c: T): List<ContentNode> { + private fun classlikeSignature(c: DClasslike): List<ContentNode> { @Suppress("UNCHECKED_CAST") - val typeAliasUnderlyingType = (c as? WithExtraProperties<out DClasslike>) + val typeAliasUnderlyingType = (c as? WithExtraProperties<DClasslike>) ?.extra ?.get(ActualTypealias) ?.underlyingType diff --git a/plugins/base/src/main/kotlin/templating/jsonMapperForPlugins.kt b/plugins/base/src/main/kotlin/templating/jsonMapperForPlugins.kt index 98cabd72..903063d3 100644 --- a/plugins/base/src/main/kotlin/templating/jsonMapperForPlugins.kt +++ b/plugins/base/src/main/kotlin/templating/jsonMapperForPlugins.kt @@ -11,6 +11,7 @@ import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.jetbrains.dokka.base.DokkaBase import java.io.File +// TODO [beresnev] try to get rid of this copy-paste in #2933 // THIS IS COPIED FROM BASE SINCE IT NEEDS TO BE INSTANTIATED ON THE SAME CLASS LOADER AS PLUGINS private val objectMapper = run { @@ -26,10 +27,11 @@ private val objectMapper = run { } @PublishedApi -internal class TypeReference<T> private constructor( +internal class TypeReference<T> @PublishedApi internal constructor( internal val jackson: com.fasterxml.jackson.core.type.TypeReference<T> ) { companion object { + @PublishedApi internal inline operator fun <reified T> invoke(): TypeReference<T> = TypeReference(jacksonTypeRef()) } } @@ -53,4 +55,4 @@ private object FileSerializer : StdScalarSerializer<File>(File::class.java) { private class PluginTypeFactory: TypeFactory(null) { override fun findClass(className: String): Class<out Any>? = Class.forName(className, true, DokkaBase::class.java.classLoader) ?: super.findClass(className) -}
\ No newline at end of file +} diff --git a/plugins/base/src/main/kotlin/transformers/documentables/utils.kt b/plugins/base/src/main/kotlin/transformers/documentables/utils.kt index 079cebea..379855ea 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/utils.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/utils.kt @@ -5,11 +5,11 @@ import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.model.ExceptionInSupertypes import org.jetbrains.dokka.model.properties.WithExtraProperties -val <T : WithExtraProperties<out Documentable>> T.isException: Boolean +val <T : Documentable> WithExtraProperties<T>.isException: Boolean get() = extra[ExceptionInSupertypes] != null -val <T> T.deprecatedAnnotation where T : WithExtraProperties<out Documentable> +val <T : Documentable> WithExtraProperties<T>.deprecatedAnnotation get() = extra[Annotations]?.let { annotations -> annotations.directAnnotations.values.flatten().firstOrNull { it.isDeprecated() @@ -20,7 +20,7 @@ val <T> T.deprecatedAnnotation where T : WithExtraProperties<out Documentable> * @return true if [T] has [kotlin.Deprecated] or [java.lang.Deprecated] * annotation for **any** source set */ -fun <T> T.isDeprecated() where T : WithExtraProperties<out Documentable> = deprecatedAnnotation != null +fun <T : Documentable> WithExtraProperties<T>.isDeprecated() = deprecatedAnnotation != null /** * @return true for [kotlin.Deprecated] and [java.lang.Deprecated] diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index 98cf6ab6..1abd3441 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -724,7 +724,7 @@ private val divergentDocumentableComparator = @Suppress("UNCHECKED_CAST") private fun <T : Documentable> T.nameAfterClash(): String = - ((this as? WithExtraProperties<out Documentable>)?.extra?.get(DriClashAwareName)?.value ?: name).orEmpty() + ((this as? WithExtraProperties<Documentable>)?.extra?.get(DriClashAwareName)?.value ?: name).orEmpty() @Suppress("UNCHECKED_CAST") internal inline fun <reified T : TagWrapper> GroupedTags.withTypeUnnamed(): SourceSetDependent<T> = |