Skip to content

Commit

Permalink
Update dependencies (#958)
Browse files Browse the repository at this point in the history
* Gradle 8.8 -> 8.9
* kotlin-node 20.11.30-pre.765 -> 20.14.10-pre.773
* kotlin-multiplatform-bignum 0.3.9 -> 0.3.10
* KSP 2.0.0-1.0.22 -> 2.0.0-1.0.23
* KotlinPoet 1.17.0 -> 1.18.1
* Binary compatibility validator 0.15.0-Beta.3 -> 0.15.1
* gradle-buildconfig-plugin 5.3.5 -> 5.4.0
* Replace jershell/kbson with mongodb/kbson
  • Loading branch information
DRSchlaubi authored Jul 16, 2024
1 parent 0e4c537 commit 99c67d7
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 18 deletions.
1 change: 0 additions & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ kotlin {
}
jvmTest {
dependencies {
implementation(libs.bson)
implementation(libs.kbson)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
),
)
}
}
18 changes: 8 additions & 10 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.1" # 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]
Expand Down Expand Up @@ -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
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##########################################################################
Expand Down

0 comments on commit 99c67d7

Please sign in to comment.