From 45c372ebc41ee0d116bd780d60b538bbc0961ac3 Mon Sep 17 00:00:00 2001 From: Alexander Sysoev Date: Mon, 4 Aug 2025 15:46:52 +0200 Subject: [PATCH] Fix LV and signing --- .../main/kotlin/conventions-publishing.gradle.kts | 6 ++++++ krpc/krpc-test/build.gradle.kts | 12 ++++++++++++ .../kotlinx/rpc/krpc/test/KrpcTransportTestBase.kt | 6 +++--- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts b/gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts index 900762738..29209843e 100644 --- a/gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts +++ b/gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts @@ -73,6 +73,12 @@ fun PublishingExtension.configurePublication() { fixModuleMetadata(project) } + // no way around this: https://github.com/gradle/gradle/issues/26091 + val signingTasks = tasks.withType() + tasks.withType().configureEach { + dependsOn(signingTasks) + } + logger.info("Project ${project.name} -> Publication configured: $name, $version") } } diff --git a/krpc/krpc-test/build.gradle.kts b/krpc/krpc-test/build.gradle.kts index dff27600b..953a3e880 100644 --- a/krpc/krpc-test/build.gradle.kts +++ b/krpc/krpc-test/build.gradle.kts @@ -3,8 +3,10 @@ */ import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode +import org.jetbrains.kotlin.gradle.dsl.KotlinVersion import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import java.nio.file.Files plugins { @@ -14,6 +16,16 @@ plugins { alias(libs.plugins.atomicfu) } +tasks.withType { + if (this.name.contains("Test")) { + compilerOptions { + // for kotlin.time.Clock API + languageVersion.set(KotlinVersion.KOTLIN_2_1) + apiVersion.set(KotlinVersion.KOTLIN_2_1) + } + } +} + kotlin { sourceSets { commonMain { diff --git a/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTransportTestBase.kt b/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTransportTestBase.kt index 6b9b6fa46..3ea42e6a0 100644 --- a/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTransportTestBase.kt +++ b/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTransportTestBase.kt @@ -305,13 +305,13 @@ abstract class KrpcTransportTestBase { } @Test - fun `RPC should be able to receive 100_000 ints in reasonable time`() = runTest(timeout = JS_EXTENDED_TIMEOUT) { + fun RPC_should_be_able_to_receive_100_000_ints_in_reasonable_time() = runTest(timeout = JS_EXTENDED_TIMEOUT) { val n = 100_000 assertEquals(client.getNInts(n).last(), n) } @Test - fun `RPC should be able to receive 100_000 ints with batching in reasonable time`() = runTest { + fun RPC_should_be_able_to_receive_100_000_ints_with_batching_in_reasonable_time() = runTest { val n = 100_000 assertEquals(client.getNIntsBatched(n).last().last(), n) } @@ -405,7 +405,7 @@ abstract class KrpcTransportTestBase { } @Test - fun `rpc continuation is called in the correct scope and doesn't block other rpcs`() = runTest { + fun rpc_continuation_is_called_in_the_correct_scope_and_doesnt_block_other_rpcs() = runTest { if (isJs) { println("Test is skipped on JS, because it doesn't support multiple threads.") return@runTest