From ee94ad365266e95c2a263c0e96dbfe31a4d901d2 Mon Sep 17 00:00:00 2001 From: Luca Kellermann Date: Fri, 26 Jul 2024 12:56:47 +0200 Subject: [PATCH] Update Kotlin to 2.1.0-dev-2499 With [1], the CONTEXT_RECEIVERS_DEPRECATED warning can now be suppressed via a single CLI flag instead of an annotation in every file. [1] https://youtrack.jetbrains.com/issue/KT-8087 --- gradle/libs.versions.toml | 2 +- ksp-processors/build.gradle.kts | 5 ++++- .../main/kotlin/generation/bitflags/BitFlagsGeneration.kt | 2 -- .../src/main/kotlin/generation/bitflags/Builder.kt | 2 -- .../main/kotlin/generation/bitflags/ContainsPlusMinusCopy.kt | 2 -- .../kotlin/generation/bitflags/DeprecatedNewCompanion.kt | 2 -- .../src/main/kotlin/generation/bitflags/Documentation.kt | 2 -- .../src/main/kotlin/generation/bitflags/FactoryFunctions.kt | 2 -- .../src/main/kotlin/generation/bitflags/Serializer.kt | 2 -- .../src/main/kotlin/generation/kordenum/Serializer.kt | 2 -- .../main/kotlin/generation/shared/EqualsHashCodeToString.kt | 2 -- .../kotlin/generation/shared/FileSpecForGenerationEntity.kt | 2 -- ksp-processors/src/main/kotlin/generation/shared/OptIns.kt | 2 -- .../src/main/kotlin/generation/shared/SharedContent.kt | 2 -- 14 files changed, 5 insertions(+), 26 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c245692b877c..742136d7299d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] # api dependencies -kotlin = "2.1.0-dev-1329" # https://github.com/JetBrains/kotlin +kotlin = "2.1.0-dev-2499" # https://github.com/JetBrains/kotlin ktor = "2.3.12" # https://github.com/ktorio/ktor kotlinx-coroutines = "1.8.1" # https://github.com/Kotlin/kotlinx.coroutines kotlinx-serialization = "1.7.1" # https://github.com/Kotlin/kotlinx.serialization diff --git a/ksp-processors/build.gradle.kts b/ksp-processors/build.gradle.kts index 5df3edcbbfe4..c6f62818ea95 100644 --- a/ksp-processors/build.gradle.kts +++ b/ksp-processors/build.gradle.kts @@ -4,7 +4,10 @@ plugins { kotlin { compilerOptions { - freeCompilerArgs.add("-Xcontext-receivers") + freeCompilerArgs.addAll( + "-Xcontext-receivers", + "-Xsuppress-warning=CONTEXT_RECEIVERS_DEPRECATED", + ) } } diff --git a/ksp-processors/src/main/kotlin/generation/bitflags/BitFlagsGeneration.kt b/ksp-processors/src/main/kotlin/generation/bitflags/BitFlagsGeneration.kt index 72697797fc10..10ae5f009c25 100644 --- a/ksp-processors/src/main/kotlin/generation/bitflags/BitFlagsGeneration.kt +++ b/ksp-processors/src/main/kotlin/generation/bitflags/BitFlagsGeneration.kt @@ -1,5 +1,3 @@ -@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED") - package dev.kord.ksp.generation.bitflags import com.google.devtools.ksp.symbol.KSFile diff --git a/ksp-processors/src/main/kotlin/generation/bitflags/Builder.kt b/ksp-processors/src/main/kotlin/generation/bitflags/Builder.kt index ca0ad0acbba5..5bccf4fe2b39 100644 --- a/ksp-processors/src/main/kotlin/generation/bitflags/Builder.kt +++ b/ksp-processors/src/main/kotlin/generation/bitflags/Builder.kt @@ -1,5 +1,3 @@ -@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED") - package dev.kord.ksp.generation.bitflags import com.squareup.kotlinpoet.ClassName diff --git a/ksp-processors/src/main/kotlin/generation/bitflags/ContainsPlusMinusCopy.kt b/ksp-processors/src/main/kotlin/generation/bitflags/ContainsPlusMinusCopy.kt index a4fb3c62bbc3..2ab53bcd7106 100644 --- a/ksp-processors/src/main/kotlin/generation/bitflags/ContainsPlusMinusCopy.kt +++ b/ksp-processors/src/main/kotlin/generation/bitflags/ContainsPlusMinusCopy.kt @@ -1,5 +1,3 @@ -@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED") - package dev.kord.ksp.generation.bitflags import com.squareup.kotlinpoet.* diff --git a/ksp-processors/src/main/kotlin/generation/bitflags/DeprecatedNewCompanion.kt b/ksp-processors/src/main/kotlin/generation/bitflags/DeprecatedNewCompanion.kt index 91267698754e..d3e4c0608d50 100644 --- a/ksp-processors/src/main/kotlin/generation/bitflags/DeprecatedNewCompanion.kt +++ b/ksp-processors/src/main/kotlin/generation/bitflags/DeprecatedNewCompanion.kt @@ -1,5 +1,3 @@ -@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED") - package dev.kord.ksp.generation.bitflags import com.squareup.kotlinpoet.DelicateKotlinPoetApi diff --git a/ksp-processors/src/main/kotlin/generation/bitflags/Documentation.kt b/ksp-processors/src/main/kotlin/generation/bitflags/Documentation.kt index b54275be9b75..0445a7f46a2f 100644 --- a/ksp-processors/src/main/kotlin/generation/bitflags/Documentation.kt +++ b/ksp-processors/src/main/kotlin/generation/bitflags/Documentation.kt @@ -1,5 +1,3 @@ -@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED") - package dev.kord.ksp.generation.bitflags import com.squareup.kotlinpoet.CodeBlock diff --git a/ksp-processors/src/main/kotlin/generation/bitflags/FactoryFunctions.kt b/ksp-processors/src/main/kotlin/generation/bitflags/FactoryFunctions.kt index effe61f5b2e0..796e02c2750b 100644 --- a/ksp-processors/src/main/kotlin/generation/bitflags/FactoryFunctions.kt +++ b/ksp-processors/src/main/kotlin/generation/bitflags/FactoryFunctions.kt @@ -1,5 +1,3 @@ -@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED") - package dev.kord.ksp.generation.bitflags import com.squareup.kotlinpoet.* diff --git a/ksp-processors/src/main/kotlin/generation/bitflags/Serializer.kt b/ksp-processors/src/main/kotlin/generation/bitflags/Serializer.kt index 130c08dd9fce..1da43eefe472 100644 --- a/ksp-processors/src/main/kotlin/generation/bitflags/Serializer.kt +++ b/ksp-processors/src/main/kotlin/generation/bitflags/Serializer.kt @@ -1,5 +1,3 @@ -@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED") - package dev.kord.ksp.generation.bitflags import com.squareup.kotlinpoet.KModifier.OVERRIDE diff --git a/ksp-processors/src/main/kotlin/generation/kordenum/Serializer.kt b/ksp-processors/src/main/kotlin/generation/kordenum/Serializer.kt index 864ed48e0396..91a13cd04933 100644 --- a/ksp-processors/src/main/kotlin/generation/kordenum/Serializer.kt +++ b/ksp-processors/src/main/kotlin/generation/kordenum/Serializer.kt @@ -1,5 +1,3 @@ -@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED") - package dev.kord.ksp.generation.kordenum import com.squareup.kotlinpoet.KModifier.OVERRIDE diff --git a/ksp-processors/src/main/kotlin/generation/shared/EqualsHashCodeToString.kt b/ksp-processors/src/main/kotlin/generation/shared/EqualsHashCodeToString.kt index b82c7031c88b..79419e2fa175 100644 --- a/ksp-processors/src/main/kotlin/generation/shared/EqualsHashCodeToString.kt +++ b/ksp-processors/src/main/kotlin/generation/shared/EqualsHashCodeToString.kt @@ -1,5 +1,3 @@ -@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED") - package dev.kord.ksp.generation.shared import com.squareup.kotlinpoet.ClassName diff --git a/ksp-processors/src/main/kotlin/generation/shared/FileSpecForGenerationEntity.kt b/ksp-processors/src/main/kotlin/generation/shared/FileSpecForGenerationEntity.kt index 9021e12cdbcc..e59208b219fa 100644 --- a/ksp-processors/src/main/kotlin/generation/shared/FileSpecForGenerationEntity.kt +++ b/ksp-processors/src/main/kotlin/generation/shared/FileSpecForGenerationEntity.kt @@ -1,5 +1,3 @@ -@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED") - package dev.kord.ksp.generation.shared import com.google.devtools.ksp.symbol.KSFile diff --git a/ksp-processors/src/main/kotlin/generation/shared/OptIns.kt b/ksp-processors/src/main/kotlin/generation/shared/OptIns.kt index 23bdf44c843f..6231e76a2c48 100644 --- a/ksp-processors/src/main/kotlin/generation/shared/OptIns.kt +++ b/ksp-processors/src/main/kotlin/generation/shared/OptIns.kt @@ -1,5 +1,3 @@ -@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED") - package dev.kord.ksp.generation.shared import com.squareup.kotlinpoet.Annotatable diff --git a/ksp-processors/src/main/kotlin/generation/shared/SharedContent.kt b/ksp-processors/src/main/kotlin/generation/shared/SharedContent.kt index 7ec592410b44..5208a238370b 100644 --- a/ksp-processors/src/main/kotlin/generation/shared/SharedContent.kt +++ b/ksp-processors/src/main/kotlin/generation/shared/SharedContent.kt @@ -1,5 +1,3 @@ -@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED") - package dev.kord.ksp.generation.shared import com.squareup.kotlinpoet.*