diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 2fe2e4d7cc7..f7a83f890df 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -39,7 +39,6 @@ kotlin { } jvmTest { dependencies { - implementation(libs.bson) implementation(libs.kbson) } } diff --git a/common/src/jvmTest/kotlin/serialization/LongOrStringSerializerBsonTest.kt b/common/src/jvmTest/kotlin/serialization/LongOrStringSerializerBsonTest.kt index 8de11b28628..7613ccd1d76 100644 --- a/common/src/jvmTest/kotlin/serialization/LongOrStringSerializerBsonTest.kt +++ b/common/src/jvmTest/kotlin/serialization/LongOrStringSerializerBsonTest.kt @@ -1,9 +1,10 @@ package dev.kord.common.serialization -import com.github.jershell.kbson.KBson import dev.kord.common.entity.Permission.* import dev.kord.common.entity.Permissions import kotlinx.serialization.Serializable +import org.mongodb.kbson.ExperimentalKBsonSerializerApi +import org.mongodb.kbson.serialization.EJson import kotlin.random.Random import kotlin.test.Test import kotlin.test.assertEquals @@ -23,16 +24,23 @@ class LongOrStringSerializerBsonTest { somePermissions = Permissions(DeafenMembers, ManageThreads, SendTTSMessages, ModerateMembers), ) + @OptIn(ExperimentalKBsonSerializerApi::class) @Test fun `test Bson serialization and deserialization with LongOrStringSerializer`() { - val kBson = KBson.default + val kBson = EJson.Default assertEquals( expected = someObject, - actual = kBson.load(SomeObject.serializer(), kBson.stringify(SomeObject.serializer(), someObject)), + actual = kBson.decodeFromString( + SomeObject.serializer(), + kBson.encodeToString(SomeObject.serializer(), someObject) + ), ) assertEquals( expected = someObject, - actual = kBson.load(SomeObject.serializer(), kBson.dump(SomeObject.serializer(), someObject)), + actual = kBson.decodeFromBsonValue( + SomeObject.serializer(), + kBson.encodeToBsonValue(SomeObject.serializer(), someObject) + ), ) } -} +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c37329d7dd4..1371788e34c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -12,27 +12,26 @@ kord-cache = "0.5.4" # https://github.com/kordlib/cache kotlin-logging = "7.0.0" # https://github.com/oshai/kotlin-logging kotlin-logging-old = "3.0.5" # TODO remove after dependency is removed in rest, gateway, voice and core slf4j = "2.0.13" # https://www.slf4j.org -kotlin-node = "20.11.30-pre.765" # https://github.com/JetBrains/kotlin-wrappers -bignum = "0.3.9" # https://github.com/ionspin/kotlin-multiplatform-bignum +kotlin-node = "20.14.10-pre.773" # https://github.com/JetBrains/kotlin-wrappers +bignum = "0.3.10" # https://github.com/ionspin/kotlin-multiplatform-bignum stately = "2.0.7" # https://github.com/touchlab/Stately fastZlib = "2.0.1" # https://github.com/timotejroiko/fast-zlib # code generation -ksp = "2.0.0-1.0.22" # https://github.com/google/ksp -kotlinpoet = "1.17.0" # https://github.com/square/kotlinpoet +ksp = "2.0.0-1.0.23" # https://github.com/google/ksp +kotlinpoet = "1.18.0" # https://github.com/square/kotlinpoet # tests junit-jupiter = "5.10.3" # https://github.com/junit-team/junit5 junit-platform = "1.10.3" mockk = "1.13.11" # https://github.com/mockk/mockk -bson = "5.1.1" # https://github.com/mongodb/mongo-java-driver -kbson = "0.5.0" # https://github.com/jershell/kbson +kbson = "0.4.0" # https://github.com/mongodb/kbson # plugins dokka = "1.9.20" # https://github.com/Kotlin/dokka kotlinx-atomicfu = "0.25.0" # https://github.com/Kotlin/kotlinx-atomicfu -binary-compatibility-validator = "0.15.0-Beta.3" # https://github.com/Kotlin/binary-compatibility-validator -buildconfig = "5.3.5" # https://github.com/gmazzo/gradle-buildconfig-plugin +binary-compatibility-validator = "0.15.1" # https://github.com/Kotlin/binary-compatibility-validator +buildconfig = "5.4.0" # https://github.com/gmazzo/gradle-buildconfig-plugin [libraries] @@ -83,8 +82,7 @@ junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", vers junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version = "junit-platform" } mockk = { module = "io.mockk:mockk", version.ref = "mockk" } slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" } -bson = { module = "org.mongodb:bson", version.ref = "bson" } -kbson = { module = "com.github.jershell:kbson", version.ref = "kbson" } +kbson = { module = "org.mongodb.kbson:kbson", version.ref = "kbson" } # actually plugins, not libraries, but used is 'buildSrc/build.gradle.kts' as implementation dependencies: # https://docs.gradle.org/current/userguide/custom_plugins.html#applying_external_plugins_in_precompiled_script_plugins diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e6441136f3d..2c3521197d7 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8a1f6b97f47..68e8816d71c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=a4b4158601f8636cdeeab09bd76afb640030bb5b144aafe261a5e8af027dc612 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index b740cf13397..f5feea6d6b1 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 25da30dbdee..9d21a21834d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ##########################################################################