[build] Update to Kotlin 1.7.10:

Kotlin 1.7.10
kotlinx-serialization 1.3.3
kotlinx-coroutines 1.6.4
kotlinx-atomicfu 0.17.3
Ktor 2.1.0
This commit is contained in:
Him188 2022-08-15 18:36:07 +08:00
parent e6bef9ce1e
commit 39074f1764
No known key found for this signature in database
GPG Key ID: BA439CDDCF652375
6 changed files with 21 additions and 23 deletions

View File

@ -26,22 +26,19 @@ object Versions {
val consoleIntellij = "221-$project-171-1" // idea-mirai-kotlin-patch
val consoleTerminal = project
const val kotlinCompiler = "1.7.0"
const val kotlinCompiler = "1.7.10"
const val kotlinStdlib = kotlinCompiler
const val dokka = "1.6.21"
const val dokka = "1.7.10"
const val kotlinCompilerForIdeaPlugin = "1.7.10"
const val coroutines = "1.6.2"
const val atomicFU = "0.17.2"
const val serialization = "1.3.2"
const val ktor = "2.0.2"
const val coroutines = "1.6.4"
const val atomicFU = "0.17.3"
const val serialization = "1.3.3"
const val ktor = "2.1.0"
const val binaryValidator = "0.4.0"
const val io = "0.1.16"
const val coroutinesIo = "0.1.16"
const val blockingBridge = "2.1.0-170.1"
const val dynamicDelegation = "0.3.0-170.1"
const val mavenCentralPublish = "1.0.0-dev-3"
@ -86,9 +83,6 @@ val `kotlinx-serialization-core` = kotlinx("serialization-core", Versions.serial
val `kotlinx-serialization-json` = kotlinx("serialization-json", Versions.serialization)
val `kotlinx-serialization-protobuf` = kotlinx("serialization-protobuf", Versions.serialization)
const val `kotlinx-atomicfu` = "org.jetbrains.kotlinx:atomicfu:${Versions.atomicFU}"
val `kotlinx-io-common` = kotlinx("io", Versions.io)
val `kotlinx-io-jvm` = kotlinx("io-jvm", Versions.io)
val `kotlinx-io-native` = kotlinx("io-macosx64", Versions.io)
val `ktor-io` = ktor("io", Versions.ktor)
@ -108,8 +102,6 @@ fun KotlinDependencyHandler.implementationKotlinxIo(module: String) {
}
}
val `kotlinx-coroutines-io` = kotlinx("coroutines-io", Versions.coroutinesIo)
val `ktor-serialization` = ktor("serialization", Versions.ktor)
val `ktor-client-core` = ktor("client-core", Versions.ktor)

View File

@ -57,6 +57,12 @@
- 构建其他 JVM 项目
- 基于新架构实现新消息协议支持
- 优化文档细节 (#2182 @2938137849)
- 更新依赖
- Kotlin 1.7.10
- kotlinx-serialization 1.3.3
- kotlinx-coroutines 1.6.4
- kotlinx-atomicfu 0.17.3
- Ktor 2.1.0
## mirai-console

View File

@ -137,7 +137,7 @@ public interface BotFactory {
qq: Long,
password: String,
configuration: BotConfiguration.() -> Unit /* = BotConfiguration.() -> Unit */
): Bot = newBot(qq, password, configuration.run { BotConfiguration().apply(configuration) })
): Bot = newBot(qq, password, BotConfiguration().apply(configuration))
// implementation notes: this is inline for `inheritCoroutineContext()`
// see https://github.com/mamoe/mirai/commit/0dbb448cad1ed4773d48ccb8c0b497841bc9fa4c#r50249446
@ -159,6 +159,6 @@ public interface BotFactory {
qq: Long,
passwordMd5: ByteArray,
configuration: BotConfiguration.() -> Unit /* = BotConfiguration.() -> Unit */
): Bot = newBot(qq, passwordMd5, configuration.run { BotConfiguration().apply(configuration) })
): Bot = newBot(qq, passwordMd5, BotConfiguration().apply(configuration))
}
}

View File

@ -37,7 +37,7 @@ internal abstract class AbstractPolymorphicSerializer<T : Any> internal construc
var klassName: String? = null
var value: Any? = null
if (decodeSequentially()) {
return decodeSequentially(this)
return@decodeStructure decodeSequentially(this)
}
mainLoop@ while (true) {

View File

@ -211,7 +211,7 @@ public interface Image : Message, MessageContent, CodableMessage {
// Note: Manually written to overcome discriminator issues.
// Without this implementation you will need `ignoreUnknownKeys` on deserialization.
override fun deserialize(decoder: Decoder): Image {
decoder.decodeStructure(descriptor) {
return decoder.decodeStructure(descriptor) {
if (this.decodeSequentially()) {
val imageId = this.decodeStringElement(descriptor, 0)
val size = this.decodeLongElement(descriptor, 1)
@ -219,7 +219,7 @@ public interface Image : Message, MessageContent, CodableMessage {
val width = this.decodeIntElement(descriptor, 3)
val height = this.decodeIntElement(descriptor, 4)
val isEmoji = this.decodeBooleanElement(descriptor, 5)
return Image(imageId) {
return@decodeStructure Image(imageId) {
this.size = size
this.type = type
this.width = width
@ -227,7 +227,7 @@ public interface Image : Message, MessageContent, CodableMessage {
this.isEmoji = isEmoji
}
} else {
return Image("") {
return@decodeStructure Image("") {
while (true) {
when (val index = this@decodeStructure.decodeElementIndex(descriptor)) {
0 -> imageId = this@decodeStructure.decodeStringElement(descriptor, index)

View File

@ -602,9 +602,9 @@ internal abstract class AbstractMessageProtocolTest : AbstractMockNetworkHandler
}
override fun deserialize(decoder: Decoder): SingleMessage {
decoder.decodeStructure(descriptor) {
return decoder.decodeStructure(descriptor) {
if (this.decodeSequentially()) {
return this.decodeSerializableElement(
this.decodeSerializableElement(
descriptor.getElementDescriptor(0),
0,
messageSerializer
@ -612,7 +612,7 @@ internal abstract class AbstractMessageProtocolTest : AbstractMockNetworkHandler
} else {
val index = this.decodeElementIndex(descriptor)
check(index == 0)
return this.decodeSerializableElement(descriptor, index, messageSerializer)
this.decodeSerializableElement(descriptor, index, messageSerializer)
}
}
}