Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #920

Merged
merged 4 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions .github/workflows/deployment-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
with:
distribution: temurin
java-version: 11
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: --stacktrace --info build
run: ./gradlew --stacktrace --info build
release:
name: Publish artifacts
runs-on: ubuntu-latest
Expand All @@ -53,11 +53,9 @@ jobs:
with:
distribution: temurin
java-version: 11
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: --stacktrace --info build
run: ./gradlew --stacktrace --info build
- name: Publish with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: --no-parallel -x test publish
run: ./gradlew --no-parallel -x test publish
6 changes: 3 additions & 3 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
with:
distribution: temurin
java-version: 11
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build docs with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: --stacktrace --info dokkaHtmlMultiModule
run: ./gradlew --stacktrace --info dokkaHtmlMultiModule
- name: Deploy docs to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ kotlin {
jvm()
js {
nodejs()
useCommonJs()
}
jvmToolchain(Jvm.target)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ kotlin {
jvm()
js {
nodejs()
useCommonJs()
}
jvmToolchain(Jvm.target)

Expand Down
6 changes: 0 additions & 6 deletions common/api/common.api
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ public final class dev/kord/common/ColorKt {
public static final fun getKColor (Ljava/awt/Color;)Ldev/kord/common/Color;
}

public final class dev/kord/common/ConcurrentHashMapKt {
}

public final class dev/kord/common/DiscordBitSet {
public static final field Companion Ldev/kord/common/DiscordBitSet$Companion;
public fun <init> ([J)V
Expand Down Expand Up @@ -9013,9 +9010,6 @@ public abstract class dev/kord/common/exception/RequestException : java/lang/Exc
public fun <init> (Ljava/lang/Throwable;)V
}

public final class dev/kord/common/http/HttpEngineKt {
}

public abstract class dev/kord/common/ratelimit/AbstractIntervalRateLimiter : dev/kord/common/ratelimit/IntervalRateLimiter {
public synthetic fun <init> (IJLkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun consume (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Expand Down
3 changes: 0 additions & 3 deletions core/api/core.api
Original file line number Diff line number Diff line change
Expand Up @@ -2160,9 +2160,6 @@ public final class dev/kord/core/builder/kord/KordBuilder : dev/kord/core/builde
public final fun setEnableShutdownHook (Z)V
}

public final class dev/kord/core/builder/kord/KordBuilderUtilKt {
}

public final class dev/kord/core/builder/kord/KordProxyBuilder : dev/kord/core/builder/kord/RestOnlyBuilder {
public fun <init> (Ldev/kord/common/entity/Snowflake;)V
public fun getApplicationId ()Ldev/kord/common/entity/Snowflake;
Expand Down
12 changes: 0 additions & 12 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11

plugins {
`kord-multiplatform-module`
`kord-publishing`
Expand Down Expand Up @@ -49,14 +47,4 @@ tasks {
dokkaHtmlMultiModule {
enabled = false
}
compileTestKotlinJvm {
compilerOptions {
// needed to inline MockK functions
jvmTarget = JVM_11
}
}
jvmTest {
// needed to run the output of compileTestKotlinJvm targeting jvm 11
javaLauncher = project.javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(11) }
}
}
6 changes: 5 additions & 1 deletion gateway/src/commonTest/kotlin/retry/LinearRetryTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class LinearRetryTest {
val end = currentTime
val elapsed = (end - start).milliseconds

assertEquals(1000.seconds, elapsed)
// first retry is exactly 1s, retries 2 to 1000 are between 1.000000027s and 1.000027447s,
// kotlinx.coroutines.delay (used by LinearRetry) rounds nanoseconds up to full milliseconds since 1.8.0:
// https://github.com/Kotlin/kotlinx.coroutines/pull/3921
// -> 1s + 999 * 1.001s = 1000.999s
assertEquals(1000.seconds + 999.milliseconds, elapsed)
}
}
1 change: 0 additions & 1 deletion gateway/src/jsMain/kotlin/internal/JsInflater.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@file:JsModule("fast-zlib")
@file:JsNonModule

package dev.kord.gateway.internal

Expand Down
34 changes: 17 additions & 17 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
[versions]

# api dependencies
kotlin = "1.9.21" # https://github.com/JetBrains/kotlin
ktor = "2.3.7" # https://github.com/ktorio/ktor
kotlinx-coroutines = "1.7.3" # https://github.com/Kotlin/kotlinx.coroutines
kotlinx-serialization = "1.6.2" # https://github.com/Kotlin/kotlinx.serialization
kotlin = "1.9.22" # https://github.com/JetBrains/kotlin
ktor = "2.3.9" # https://github.com/ktorio/ktor
kotlinx-coroutines = "1.8.0" # https://github.com/Kotlin/kotlinx.coroutines
kotlinx-serialization = "1.6.3" # https://github.com/Kotlin/kotlinx.serialization
kotlinx-datetime = "0.5.0" # https://github.com/Kotlin/kotlinx-datetime
kotlin-logging = "6.0.1" # https://github.com/oshai/kotlin-logging
kotlin-logging-old = "3.0.5" # TODO remove after dependency is removed in rest, gateway, voice and core
kord-cache = "0.4.0" # https://github.com/kordlib/cache

# implementation dependencies
kotlin-node = "18.16.12-pre.619" # https://github.com/JetBrains/kotlin-wrappers
bignum = "0.3.8" # https://github.com/ionspin/kotlin-multiplatform-bignum
kotlin-logging = "6.0.3" # 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.12" # https://www.slf4j.org
kotlin-node = "20.11.5-pre.706" # https://github.com/JetBrains/kotlin-wrappers
bignum = "0.3.9" # https://github.com/ionspin/kotlin-multiplatform-bignum
stately = "2.0.6" # https://github.com/touchlab/Stately
fastZlib = "2.0.1" # https://github.com/timotejroiko/fast-zlib

# code generation
ksp = "1.9.21-1.0.16" # https://github.com/google/ksp
kotlinpoet = "1.15.3" # https://github.com/square/kotlinpoet
ksp = "1.9.22-1.0.17" # https://github.com/google/ksp
kotlinpoet = "1.16.0" # https://github.com/square/kotlinpoet

# tests
junit5 = "5.10.1" # https://github.com/junit-team/junit5
mockk = "1.13.8" # https://github.com/mockk/mockk
slf4j = "2.0.9" # https://www.slf4j.org
junit5 = "5.10.2" # https://github.com/junit-team/junit5
mockk = "1.13.10" # https://github.com/mockk/mockk

# plugins
dokka = "1.9.10" # https://github.com/Kotlin/dokka
kotlinx-atomicfu = "0.23.1" # https://github.com/Kotlin/kotlinx-atomicfu
binary-compatibility-validator = "0.13.2" # https://github.com/Kotlin/binary-compatibility-validator
buildconfig = "5.1.0" # https://github.com/gmazzo/gradle-buildconfig-plugin
dokka = "1.9.20" # https://github.com/Kotlin/dokka
kotlinx-atomicfu = "0.23.2" # https://github.com/Kotlin/kotlinx-atomicfu
binary-compatibility-validator = "0.14.0" # https://github.com/Kotlin/binary-compatibility-validator
buildconfig = "5.3.5" # https://github.com/gmazzo/gradle-buildconfig-plugin


[libraries]
Expand Down
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=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionSha256Sum=9631d53cf3e74bfa726893aee1f8994fee4e060c401335946dba2156f440f24c
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
// https://github.com/gradle/foojay-toolchains
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}

rootProject.name = "kord"
Expand Down
14 changes: 3 additions & 11 deletions test-kit/src/jsMain/kotlin/Platform.node.kt
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
package dev.kord.test

import io.ktor.utils.io.*
import js.iterable.toList
import node.buffer.Buffer
import node.buffer.BufferEncoding
import node.fs.readFile
import node.process.process

internal suspend fun nodeFile(project: String, path: String): String =
node.fs.readFile("${process.env["PROJECT_ROOT"]}/$project/src/commonTest/resources/$path")
.toString(BufferEncoding.utf8)
readFile("${process.env["PROJECT_ROOT"]}/$project/src/commonTest/resources/$path", BufferEncoding.utf8)

internal suspend fun nodeReadFile(project: String, path: String): ByteReadChannel {
val buffer = node.fs.readFile("${process.env["PROJECT_ROOT"]}/$project/src/commonTest/resources/$path")

return ByteReadChannel(buffer.toByteArray())
}

private fun Buffer.toByteArray() = values().toList().toByteArray()
internal suspend fun nodeReadFile(project: String, path: String) = ByteReadChannel(nodeFile(project, path))