From 622d59822e709438802b72d82afef025b43dd564 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Thu, 26 Aug 2021 12:15:22 +0200 Subject: Bump compiler to 1.5.30, language level to 1.5 --- gradle.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gradle.properties') diff --git a/gradle.properties b/gradle.properties index 601f3777..81c7b97a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,13 +3,13 @@ dokka_version_base=1.5.21 dokka_publication_channels=maven-central-snapshot&space-dokka-dev dokka_integration_test_parallelism=2 # Versions -kotlin_version=1.5.21 +kotlin_version=1.5.30 coroutines_version=1.5.1 kotlinx_html_version=0.7.3 -kotlin_plugin_version=202-1.5.21-release-321-IJ8194.7 +kotlin_plugin_version=202-1.5.30-release-412-IJ8194.7 jsoup_version=1.13.1 idea_version=202.8194.7 -language_version=1.4 +language_version=1.5 jackson_version=2.12.4 # Code style kotlin.code.style=official -- cgit From 459a0005824de412ff7d4472c1eb4d6fb7c2a7cc Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Fri, 27 Aug 2021 13:45:27 +0200 Subject: Restore language level to 1.4 --- gradle.properties | 2 +- .../transformers/documentables/DefaultDocumentableMerger.kt | 3 ++- .../descriptors/DefaultDescriptorToDocumentableTranslator.kt | 4 +++- .../kotlin/translators/documentables/briefFromContentNodes.kt | 3 ++- .../test/kotlin/content/annotations/ContentForAnnotationsTest.kt | 9 +++++---- plugins/kotlin-as-java/src/main/kotlin/jvmField.kt | 2 +- plugins/kotlin-as-java/src/main/kotlin/jvmName.kt | 5 +++-- 7 files changed, 17 insertions(+), 11 deletions(-) (limited to 'gradle.properties') diff --git a/gradle.properties b/gradle.properties index 81c7b97a..3a15f663 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ kotlinx_html_version=0.7.3 kotlin_plugin_version=202-1.5.30-release-412-IJ8194.7 jsoup_version=1.13.1 idea_version=202.8194.7 -language_version=1.5 +language_version=1.4 jackson_version=2.12.4 # Code style kotlin.code.style=official diff --git a/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt b/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt index 8cee22b2..61a7a6a2 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt @@ -7,6 +7,7 @@ import org.jetbrains.dokka.model.properties.MergeStrategy import org.jetbrains.dokka.model.properties.mergeExtras import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.DocumentableMerger +import org.jetbrains.kotlin.util.firstNotNullResult internal class DefaultDocumentableMerger(val context: DokkaContext) : DocumentableMerger { private val dependencyInfo = context.getDependencyInfo() @@ -20,7 +21,7 @@ internal class DefaultDocumentableMerger(val context: DokkaContext) : Documentab list.flatMap { it.packages } ) { pck1, pck2 -> pck1.mergeWith(pck2) }, documentation = list.map { it.documentation }.flatMap { it.entries }.associate { (k, v) -> k to v }, - expectPresentInSet = list.firstNotNullOfOrNull { it.expectPresentInSet }, + expectPresentInSet = list.firstNotNullResult { it.expectPresentInSet }, sourceSets = list.flatMap { it.sourceSets }.toSet() ).mergeExtras(left, right) } diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index 88dde911..0cd99f08 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -62,6 +62,7 @@ import org.jetbrains.kotlin.resolve.source.PsiSourceFile import org.jetbrains.kotlin.types.* import org.jetbrains.kotlin.types.typeUtil.immediateSupertypes import org.jetbrains.kotlin.types.typeUtil.isAnyOrNullableAny +import org.jetbrains.kotlin.util.firstNotNullResult import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull import org.jetbrains.kotlin.utils.addToStdlib.safeAs import java.nio.file.Paths @@ -891,7 +892,8 @@ private class DokkaDescriptorVisitor( private fun DeclarationDescriptor.getJavaDocs() = (this as? CallableDescriptor) ?.overriddenDescriptors ?.mapNotNull { it.findPsi() as? PsiNamedElement } - ?.firstNotNullOfOrNull { javadocParser.parseDocumentation(it) } + ?.firstOrNull() + ?.let { javadocParser.parseDocumentation(it) } private suspend fun ClassDescriptor.companion(dri: DRIWithPlatformInfo): DObject? = companionObjectDescriptor?.let { objectDescriptor(it, dri) diff --git a/plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt b/plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt index 2d300ea8..bd54eedd 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt @@ -3,12 +3,13 @@ package org.jetbrains.dokka.base.translators.documentables import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.model.withDescendants import org.jetbrains.dokka.pages.* +import org.jetbrains.kotlin.util.firstNotNullResult import org.jetbrains.kotlin.utils.addToStdlib.safeAs fun firstParagraphBrief(docTag: DocTag): DocTag? = when(docTag){ is P -> docTag - is CustomDocTag -> docTag.children.firstNotNullOfOrNull { firstParagraphBrief(it) } + is CustomDocTag -> docTag.children.firstNotNullResult { firstParagraphBrief(it) } is Text -> docTag else -> null } diff --git a/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt b/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt index 78934191..5c78e885 100644 --- a/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt +++ b/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt @@ -9,6 +9,7 @@ import org.jetbrains.dokka.pages.ContentPage import org.jetbrains.dokka.pages.ContentText import org.jetbrains.dokka.pages.MemberPageNode import org.jetbrains.dokka.pages.PackagePageNode +import org.jetbrains.kotlin.util.firstNotNullResult import org.junit.jupiter.api.Test import utils.ParamAttributes import utils.assertNotNull @@ -221,8 +222,8 @@ class ContentForAnnotationsTest : BaseAbstractTest() { mustBeDocumented = false )) val property = modules.flatMap { it.packages }.flatMap { it.properties }.first() - val annotation = property.extra?.get(Annotations)?.let { - it.directAnnotations.entries.firstNotNullOfOrNull { (_, annotations): Map.Entry> -> annotations.firstOrNull() } + val annotation = property.extra[Annotations]?.let { + it.directAnnotations.entries.firstNotNullResult { (_, annotations): Map.Entry> -> annotations.firstOrNull() } } val annotationParams = annotation?.params ?: emptyMap() @@ -283,10 +284,10 @@ class ContentForAnnotationsTest : BaseAbstractTest() { val property = modules.flatMap { it.packages }.flatMap { it.properties }.first() val getterAnnotation = property.getter?.extra?.get(Annotations)?.let { - it.directAnnotations.entries.firstNotNullOfOrNull { (_, annotations) -> annotations.firstOrNull() } + it.directAnnotations.entries.firstNotNullResult { (_, annotations) -> annotations.firstOrNull() } } val setterAnnotation = property.getter?.extra?.get(Annotations)?.let { - it.directAnnotations.entries.firstNotNullOfOrNull { (_, annotations) -> annotations.firstOrNull() } + it.directAnnotations.entries.firstNotNullResult { (_, annotations) -> annotations.firstOrNull() } } assertEquals(expectedAnnotation("xd"), getterAnnotation) diff --git a/plugins/kotlin-as-java/src/main/kotlin/jvmField.kt b/plugins/kotlin-as-java/src/main/kotlin/jvmField.kt index f54f844c..3e57f4d0 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/jvmField.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/jvmField.kt @@ -5,7 +5,7 @@ import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.model.properties.WithExtraProperties internal fun WithExtraProperties.jvmField(): Annotations.Annotation? = - extra[Annotations]?.directAnnotations?.entries?.firstNotNullOfOrNull { (_, annotations) -> annotations.jvmFieldAnnotation() } + extra[Annotations]?.directAnnotations?.entries?.mapNotNull { (_, annotations) -> annotations.jvmFieldAnnotation() }?.firstOrNull() internal fun List.jvmFieldAnnotation(): Annotations.Annotation? = firstOrNull { it.dri.packageName == "kotlin.jvm" && it.dri.classNames == "JvmField" } \ No newline at end of file diff --git a/plugins/kotlin-as-java/src/main/kotlin/jvmName.kt b/plugins/kotlin-as-java/src/main/kotlin/jvmName.kt index 53f3430b..44271f2c 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/jvmName.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/jvmName.kt @@ -5,12 +5,13 @@ import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.model.StringValue import org.jetbrains.dokka.model.isJvmName import org.jetbrains.dokka.model.properties.WithExtraProperties +import org.jetbrains.kotlin.util.firstNotNullResult internal fun WithExtraProperties.directlyAnnotatedJvmName(): Annotations.Annotation? = - extra[Annotations]?.directAnnotations?.entries?.firstNotNullOfOrNull { (_, annotations)-> annotations.jvmNameAnnotation() } + extra[Annotations]?.directAnnotations?.entries?.firstNotNullResult { (_, annotations)-> annotations.jvmNameAnnotation() } internal fun WithExtraProperties.fileLevelJvmName(): Annotations.Annotation? = - extra[Annotations]?.fileLevelAnnotations?.entries?.firstNotNullOfOrNull { (_, annotations) -> annotations.jvmNameAnnotation() } + extra[Annotations]?.fileLevelAnnotations?.entries?.firstNotNullResult { (_, annotations) -> annotations.jvmNameAnnotation() } internal fun List.jvmNameAnnotation(): Annotations.Annotation? = firstOrNull { it.isJvmName() } -- cgit From fb6822793252cb2957ae0f0c2ed36aafebcf12f4 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Fri, 27 Aug 2021 15:09:00 +0200 Subject: Cleanup and version bump to 1.5.30 --- gradle.properties | 2 +- .../descriptors/DefaultDescriptorToDocumentableTranslator.kt | 1 - .../src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt | 2 +- plugins/kotlin-as-java/src/main/kotlin/jvmField.kt | 3 ++- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'gradle.properties') diff --git a/gradle.properties b/gradle.properties index 3a15f663..d100af89 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project Settings -dokka_version_base=1.5.21 +dokka_version_base=1.5.30 dokka_publication_channels=maven-central-snapshot&space-dokka-dev dokka_integration_test_parallelism=2 # Versions diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index 0cd99f08..3dc2385a 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -62,7 +62,6 @@ import org.jetbrains.kotlin.resolve.source.PsiSourceFile import org.jetbrains.kotlin.types.* import org.jetbrains.kotlin.types.typeUtil.immediateSupertypes import org.jetbrains.kotlin.types.typeUtil.isAnyOrNullableAny -import org.jetbrains.kotlin.util.firstNotNullResult import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull import org.jetbrains.kotlin.utils.addToStdlib.safeAs import java.nio.file.Paths diff --git a/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt b/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt index 5c78e885..f7f7eb66 100644 --- a/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt +++ b/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt @@ -223,7 +223,7 @@ class ContentForAnnotationsTest : BaseAbstractTest() { )) val property = modules.flatMap { it.packages }.flatMap { it.properties }.first() val annotation = property.extra[Annotations]?.let { - it.directAnnotations.entries.firstNotNullResult { (_, annotations): Map.Entry> -> annotations.firstOrNull() } + it.directAnnotations.entries.firstNotNullResult { (_, annotations) -> annotations.firstOrNull() } } val annotationParams = annotation?.params ?: emptyMap() diff --git a/plugins/kotlin-as-java/src/main/kotlin/jvmField.kt b/plugins/kotlin-as-java/src/main/kotlin/jvmField.kt index 3e57f4d0..b421bd3d 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/jvmField.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/jvmField.kt @@ -3,9 +3,10 @@ package org.jetbrains.dokka.kotlinAsJava import org.jetbrains.dokka.model.Annotations import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.model.properties.WithExtraProperties +import org.jetbrains.kotlin.util.firstNotNullResult internal fun WithExtraProperties.jvmField(): Annotations.Annotation? = - extra[Annotations]?.directAnnotations?.entries?.mapNotNull { (_, annotations) -> annotations.jvmFieldAnnotation() }?.firstOrNull() + extra[Annotations]?.directAnnotations?.entries?.firstNotNullResult { (_, annotations) -> annotations.jvmFieldAnnotation() } internal fun List.jvmFieldAnnotation(): Annotations.Annotation? = firstOrNull { it.dri.packageName == "kotlin.jvm" && it.dri.classNames == "JvmField" } \ No newline at end of file -- cgit