Skip to content

Commit

Permalink
Update Kotlin to 2.1.0-dev-758
Browse files Browse the repository at this point in the history
Context receivers will be replaced by [1] and are deprecated for now,
so the CONTEXT_RECEIVERS_DEPRECATED warning must be suppressed in the
ksp-processors project.

KSP doesn't have a published version that works with Kotlin
2.1.0-dev-758 yet, so I used a locally built KSP published to the local
Maven repository.

The changes in the KLib ABI dumps are due to [2], constructors of sealed
classes aren't public ABI.

[1] Kotlin/KEEP#367
[2] JetBrains/kotlin@56ba701
  • Loading branch information
lukellmann committed Jul 5, 2024
1 parent 32801b6 commit 9a90ee0
Show file tree
Hide file tree
Showing 23 changed files with 53 additions and 212 deletions.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ plugins {

repositories {
mavenCentral()
mavenLocal()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap")
}

group = Library.group
Expand Down
16 changes: 16 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ plugins {

repositories {
mavenCentral()
mavenLocal()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap")
}

kotlin {
Expand All @@ -14,4 +16,18 @@ kotlin {

dependencies {
implementation(libs.bundles.pluginsForBuildSrc)
constraints {
implementation("org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.9.0") {
because(
"Binary compatibility validator 0.15.0-Beta.3 uses org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.6.2 " +
"as an implementation dependency (see [1] and [2]), which doesn't support Kotlin metadata " +
"version 2.1.0. kotlinx-metadata-jvm was replaced by kotlin-metadata-jvm with Kotlin 2.0.0 (see " +
"[3]), but the new artifact is not binary compatible with the old one (the root package of its " +
"classes was changed). So we use the latest version of kotlinx-metadata-jvm (0.9.0) for now.\n\n" +
"[1] https://github.com/Kotlin/binary-compatibility-validator/blob/0.15.0-Beta.3/gradle/libs.versions.toml#L18\n" +
"[2] https://github.com/Kotlin/binary-compatibility-validator/blob/0.15.0-Beta.3/build.gradle.kts#L67\n" +
"[3] https://kotlinlang.org/docs/whatsnew20.html#the-kotlinx-metadata-jvm-library-is-stable"
)
}
}
}
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/kord-internal-module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ plugins {

repositories {
mavenCentral()
mavenLocal()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap")
}

kotlin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ plugins {

repositories {
mavenCentral()
mavenLocal()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap")
}

kotlin {
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/kord-module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ plugins {

repositories {
mavenCentral()
mavenLocal()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap")
}

dependencies {
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ plugins {

repositories {
mavenCentral()
mavenLocal()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap")
}

dependencies {
Expand Down
138 changes: 0 additions & 138 deletions common/api/common.klib.api

Large diffs are not rendered by default.

25 changes: 1 addition & 24 deletions core/api/core.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -7089,8 +7089,6 @@ final class dev.kord.core.entity/ClientStatus { // dev.kord.core.entity/ClientSt
final fun toString(): kotlin/String // dev.kord.core.entity/ClientStatus.toString|toString(){}[0]

sealed class Client { // dev.kord.core.entity/ClientStatus.Client|null[0]
constructor <init>(dev.kord.common.entity/PresenceStatus) // dev.kord.core.entity/ClientStatus.Client.<init>|<init>(dev.kord.common.entity.PresenceStatus){}[0]

final val status // dev.kord.core.entity/ClientStatus.Client.status|{}status[0]
final fun <get-status>(): dev.kord.common.entity/PresenceStatus // dev.kord.core.entity/ClientStatus.Client.status.<get-status>|<get-status>(){}[0]

Expand Down Expand Up @@ -11573,9 +11571,6 @@ open class dev.kord.core.entity/User : dev.kord.core.behavior/UserBehavior { //
}

sealed class dev.kord.core.cache.data/ComponentData { // dev.kord.core.cache.data/ComponentData|null[0]
constructor <init>() // dev.kord.core.cache.data/ComponentData.<init>|<init>(){}[0]
constructor <init>(kotlin/Int, kotlinx.serialization.internal/SerializationConstructorMarker?) // dev.kord.core.cache.data/ComponentData.<init>|<init>(kotlin.Int;kotlinx.serialization.internal.SerializationConstructorMarker?){}[0]

abstract val channelTypes // dev.kord.core.cache.data/ComponentData.channelTypes|{}channelTypes[0]
abstract fun <get-channelTypes>(): dev.kord.common.entity.optional/Optional<kotlin.collections/List<dev.kord.common.entity/ChannelType>> // dev.kord.core.cache.data/ComponentData.channelTypes.<get-channelTypes>|<get-channelTypes>(){}[0]
abstract val components // dev.kord.core.cache.data/ComponentData.components|{}components[0]
Expand Down Expand Up @@ -11619,8 +11614,6 @@ sealed class dev.kord.core.cache.data/ComponentData { // dev.kord.core.cache.dat
}

sealed class dev.kord.core.entity.automoderation/AutoModerationAction : dev.kord.core/KordObject { // dev.kord.core.entity.automoderation/AutoModerationAction|null[0]
constructor <init>(dev.kord.core.cache.data/AutoModerationActionData, dev.kord.core/Kord, dev.kord.common.entity/AutoModerationActionType?) // dev.kord.core.entity.automoderation/AutoModerationAction.<init>|<init>(dev.kord.core.cache.data.AutoModerationActionData;dev.kord.core.Kord;dev.kord.common.entity.AutoModerationActionType?){}[0]

abstract val type // dev.kord.core.entity.automoderation/AutoModerationAction.type|{}type[0]
abstract fun <get-type>(): dev.kord.common.entity/AutoModerationActionType // dev.kord.core.entity.automoderation/AutoModerationAction.type.<get-type>|<get-type>(){}[0]
final val data // dev.kord.core.entity.automoderation/AutoModerationAction.data|{}data[0]
Expand All @@ -11632,8 +11625,6 @@ sealed class dev.kord.core.entity.automoderation/AutoModerationAction : dev.kord
}

sealed class dev.kord.core.entity.automoderation/AutoModerationRule : dev.kord.core.behavior.automoderation/TypedAutoModerationRuleBehavior { // dev.kord.core.entity.automoderation/AutoModerationRule|null[0]
constructor <init>(dev.kord.core.cache.data/AutoModerationRuleData, dev.kord.core/Kord, dev.kord.core.supplier/EntitySupplier, dev.kord.common.entity/AutoModerationRuleTriggerType?) // dev.kord.core.entity.automoderation/AutoModerationRule.<init>|<init>(dev.kord.core.cache.data.AutoModerationRuleData;dev.kord.core.Kord;dev.kord.core.supplier.EntitySupplier;dev.kord.common.entity.AutoModerationRuleTriggerType?){}[0]

final val actions // dev.kord.core.entity.automoderation/AutoModerationRule.actions|{}actions[0]
final fun <get-actions>(): kotlin.collections/List<dev.kord.core.entity.automoderation/AutoModerationAction> // dev.kord.core.entity.automoderation/AutoModerationRule.actions.<get-actions>|<get-actions>(){}[0]
final val creator // dev.kord.core.entity.automoderation/AutoModerationRule.creator|{}creator[0]
Expand Down Expand Up @@ -11673,8 +11664,6 @@ sealed class dev.kord.core.entity.automoderation/AutoModerationRule : dev.kord.c
}

sealed class dev.kord.core.entity.component/SelectMenuComponent : dev.kord.core.entity.component/Component { // dev.kord.core.entity.component/SelectMenuComponent|null[0]
constructor <init>(dev.kord.core.cache.data/ComponentData) // dev.kord.core.entity.component/SelectMenuComponent.<init>|<init>(dev.kord.core.cache.data.ComponentData){}[0]

final val customId // dev.kord.core.entity.component/SelectMenuComponent.customId|{}customId[0]
final fun <get-customId>(): kotlin/String // dev.kord.core.entity.component/SelectMenuComponent.customId.<get-customId>|<get-customId>(){}[0]
final val disabled // dev.kord.core.entity.component/SelectMenuComponent.disabled|{}disabled[0]
Expand All @@ -11694,8 +11683,6 @@ sealed class dev.kord.core.entity.component/SelectMenuComponent : dev.kord.core.
}

sealed class dev.kord.core.entity.interaction.followup/FollowupMessage : dev.kord.core.behavior.interaction.followup/FollowupMessageBehavior { // dev.kord.core.entity.interaction.followup/FollowupMessage|null[0]
constructor <init>(dev.kord.core.entity/Message) // dev.kord.core.entity.interaction.followup/FollowupMessage.<init>|<init>(dev.kord.core.entity.Message){}[0]

final val message // dev.kord.core.entity.interaction.followup/FollowupMessage.message|{}message[0]
final fun <get-message>(): dev.kord.core.entity/Message // dev.kord.core.entity.interaction.followup/FollowupMessage.message.<get-message>|<get-message>(){}[0]
open val channelId // dev.kord.core.entity.interaction.followup/FollowupMessage.channelId|{}channelId[0]
Expand All @@ -11707,17 +11694,13 @@ sealed class dev.kord.core.entity.interaction.followup/FollowupMessage : dev.kor
}

sealed class dev.kord.core.entity.interaction.response/MessageInteractionResponse : dev.kord.core.behavior.interaction.response/MessageInteractionResponseBehavior { // dev.kord.core.entity.interaction.response/MessageInteractionResponse|null[0]
constructor <init>(dev.kord.core.entity/Message) // dev.kord.core.entity.interaction.response/MessageInteractionResponse.<init>|<init>(dev.kord.core.entity.Message){}[0]

final val message // dev.kord.core.entity.interaction.response/MessageInteractionResponse.message|{}message[0]
final fun <get-message>(): dev.kord.core.entity/Message // dev.kord.core.entity.interaction.response/MessageInteractionResponse.message.<get-message>|<get-message>(){}[0]

abstract fun withStrategy(dev.kord.core.supplier/EntitySupplyStrategy<*>): dev.kord.core.entity.interaction.response/MessageInteractionResponse // dev.kord.core.entity.interaction.response/MessageInteractionResponse.withStrategy|withStrategy(dev.kord.core.supplier.EntitySupplyStrategy<*>){}[0]
}

sealed class dev.kord.core.entity/BaseApplication : dev.kord.core.entity/KordEntity, dev.kord.core.entity/Strategizable { // dev.kord.core.entity/BaseApplication|null[0]
constructor <init>(dev.kord.core/Kord, dev.kord.core.supplier/EntitySupplier = ...) // dev.kord.core.entity/BaseApplication.<init>|<init>(dev.kord.core.Kord;dev.kord.core.supplier.EntitySupplier){}[0]

abstract val data // dev.kord.core.entity/BaseApplication.data|{}data[0]
abstract fun <get-data>(): dev.kord.core.cache.data/BaseApplicationData // dev.kord.core.entity/BaseApplication.data.<get-data>|<get-data>(){}[0]
final val coverImage // dev.kord.core.entity/BaseApplication.coverImage|{}coverImage[0]
Expand Down Expand Up @@ -11777,8 +11760,6 @@ sealed class dev.kord.core.entity/BaseApplication : dev.kord.core.entity/KordEnt
}

sealed class dev.kord.core.entity/ReactionEmoji { // dev.kord.core.entity/ReactionEmoji|null[0]
constructor <init>() // dev.kord.core.entity/ReactionEmoji.<init>|<init>(){}[0]

abstract val mention // dev.kord.core.entity/ReactionEmoji.mention|{}mention[0]
abstract fun <get-mention>(): kotlin/String // dev.kord.core.entity/ReactionEmoji.mention.<get-mention>|<get-mention>(){}[0]
abstract val name // dev.kord.core.entity/ReactionEmoji.name|{}name[0]
Expand Down Expand Up @@ -11833,8 +11814,6 @@ sealed class dev.kord.core.entity/ReactionEmoji { // dev.kord.core.entity/Reacti
}

sealed class dev.kord.core.event.gateway/DisconnectEvent : dev.kord.core.event.gateway/GatewayEvent { // dev.kord.core.event.gateway/DisconnectEvent|null[0]
constructor <init>() // dev.kord.core.event.gateway/DisconnectEvent.<init>|<init>(){}[0]

final class DetachEvent : dev.kord.core.event.gateway/DisconnectEvent { // dev.kord.core.event.gateway/DisconnectEvent.DetachEvent|null[0]
constructor <init>(dev.kord.core/Kord, kotlin/Int, kotlin/Any?) // dev.kord.core.event.gateway/DisconnectEvent.DetachEvent.<init>|<init>(dev.kord.core.Kord;kotlin.Int;kotlin.Any?){}[0]

Expand Down Expand Up @@ -11944,9 +11923,7 @@ sealed class dev.kord.core.event.gateway/DisconnectEvent : dev.kord.core.event.g
}
}

sealed class dev.kord.core.event.gateway/GatewayEvent : dev.kord.core.event/Event { // dev.kord.core.event.gateway/GatewayEvent|null[0]
constructor <init>() // dev.kord.core.event.gateway/GatewayEvent.<init>|<init>(){}[0]
}
sealed class dev.kord.core.event.gateway/GatewayEvent : dev.kord.core.event/Event // dev.kord.core.event.gateway/GatewayEvent|null[0]

final object dev.kord.core.cache.data/NotSerializable : kotlinx.serialization/KSerializer<kotlin/Any?> { // dev.kord.core.cache.data/NotSerializable|null[0]
final val descriptor // dev.kord.core.cache.data/NotSerializable.descriptor|{}descriptor[0]
Expand Down
10 changes: 0 additions & 10 deletions gateway/api/gateway.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -2110,8 +2110,6 @@ final class dev.kord.gateway/WebhooksUpdate : dev.kord.gateway/DispatchEvent { /
}

sealed class dev.kord.gateway/Close : dev.kord.gateway/Event { // dev.kord.gateway/Close|null[0]
constructor <init>() // dev.kord.gateway/Close.<init>|<init>(){}[0]

final class DiscordClose : dev.kord.gateway/Close { // dev.kord.gateway/Close.DiscordClose|null[0]
constructor <init>(dev.kord.gateway/GatewayCloseCode, kotlin/Boolean) // dev.kord.gateway/Close.DiscordClose.<init>|<init>(dev.kord.gateway.GatewayCloseCode;kotlin.Boolean){}[0]

Expand Down Expand Up @@ -2144,8 +2142,6 @@ sealed class dev.kord.gateway/Close : dev.kord.gateway/Event { // dev.kord.gatew
}

sealed class dev.kord.gateway/Command { // dev.kord.gateway/Command|null[0]
constructor <init>() // dev.kord.gateway/Command.<init>|<init>(){}[0]

final class Heartbeat : dev.kord.gateway/Command { // dev.kord.gateway/Command.Heartbeat|null[0]
constructor <init>(kotlin/Int?) // dev.kord.gateway/Command.Heartbeat.<init>|<init>(kotlin.Int?){}[0]

Expand All @@ -2168,15 +2164,11 @@ sealed class dev.kord.gateway/Command { // dev.kord.gateway/Command|null[0]
}

sealed class dev.kord.gateway/DispatchEvent : dev.kord.gateway/Event { // dev.kord.gateway/DispatchEvent|null[0]
constructor <init>() // dev.kord.gateway/DispatchEvent.<init>|<init>(){}[0]

abstract val sequence // dev.kord.gateway/DispatchEvent.sequence|{}sequence[0]
abstract fun <get-sequence>(): kotlin/Int? // dev.kord.gateway/DispatchEvent.sequence.<get-sequence>|<get-sequence>(){}[0]
}

sealed class dev.kord.gateway/Event { // dev.kord.gateway/Event|null[0]
constructor <init>() // dev.kord.gateway/Event.<init>|<init>(){}[0]

final object DeserializationStrategy : kotlinx.serialization/DeserializationStrategy<dev.kord.gateway/Event> { // dev.kord.gateway/Event.DeserializationStrategy|null[0]
final val descriptor // dev.kord.gateway/Event.DeserializationStrategy.descriptor|{}descriptor[0]
final fun <get-descriptor>(): kotlinx.serialization.descriptors/SerialDescriptor // dev.kord.gateway/Event.DeserializationStrategy.descriptor.<get-descriptor>|<get-descriptor>(){}[0]
Expand All @@ -2186,8 +2178,6 @@ sealed class dev.kord.gateway/Event { // dev.kord.gateway/Event|null[0]
}

sealed class dev.kord.gateway/Intent { // dev.kord.gateway/Intent|null[0]
constructor <init>(kotlin/Int) // dev.kord.gateway/Intent.<init>|<init>(kotlin.Int){}[0]

final val code // dev.kord.gateway/Intent.code|{}code[0]
final fun <get-code>(): dev.kord.common/DiscordBitSet // dev.kord.gateway/Intent.code.<get-code>|<get-code>(){}[0]
final val shift // dev.kord.gateway/Intent.shift|{}shift[0]
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]

# api dependencies
kotlin = "2.0.20-Beta1" # https://github.com/JetBrains/kotlin
kotlin = "2.1.0-dev-758" # 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
Expand All @@ -18,7 +18,7 @@ stately = "2.0.7" # https://github.com/touchlab/Stately
fastZlib = "2.0.1" # https://github.com/timotejroiko/fast-zlib

# code generation
ksp = "2.0.20-Beta1-1.0.22" # https://github.com/google/ksp
ksp = "2.0.255-SNAPSHOT" # https://github.com/google/ksp
kotlinpoet = "1.17.0" # https://github.com/square/kotlinpoet

# tests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED")

package dev.kord.ksp.generation.bitflags

import com.google.devtools.ksp.symbol.KSFile
Expand Down
2 changes: 2 additions & 0 deletions ksp-processors/src/main/kotlin/generation/bitflags/Builder.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED")

package dev.kord.ksp.generation.bitflags

import com.squareup.kotlinpoet.ClassName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED")

package dev.kord.ksp.generation.bitflags

import com.squareup.kotlinpoet.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED")

package dev.kord.ksp.generation.bitflags

import com.squareup.kotlinpoet.DelicateKotlinPoetApi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED")

package dev.kord.ksp.generation.bitflags

import com.squareup.kotlinpoet.CodeBlock
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED")

package dev.kord.ksp.generation.bitflags

import com.squareup.kotlinpoet.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED")

package dev.kord.ksp.generation.bitflags

import com.squareup.kotlinpoet.KModifier.OVERRIDE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED")

package dev.kord.ksp.generation.kordenum

import com.squareup.kotlinpoet.KModifier.OVERRIDE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED")

package dev.kord.ksp.generation.shared

import com.squareup.kotlinpoet.ClassName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED")

package dev.kord.ksp.generation.shared

import com.google.devtools.ksp.symbol.KSFile
Expand Down
2 changes: 2 additions & 0 deletions ksp-processors/src/main/kotlin/generation/shared/OptIns.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED")

package dev.kord.ksp.generation.shared

import com.squareup.kotlinpoet.Annotatable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("CONTEXT_RECEIVERS_DEPRECATED")

package dev.kord.ksp.generation.shared

import com.squareup.kotlinpoet.*
Expand Down
Loading

0 comments on commit 9a90ee0

Please sign in to comment.