From f283d4d4545de00060f61b2f21f38c7c80734340 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sun, 12 Jun 2022 14:46:28 +0300 Subject: [PATCH] Fix coroutines issue --- CHANGELOG.md | 2 ++ build.gradle.kts | 4 ++-- gradle/libs.versions.toml | 2 +- .../ru/mipt/npm/gradle/KScienceExtension.kt | 17 ++++++++++++----- .../ru/mipt/npm/gradle/commonConfigurations.kt | 3 --- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ae52d9..860c47a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed +- Coroutines tests are applied only when explicit `useCoroutines` is used. ### Deprecated @@ -29,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Atomicfu support inside the plugin ### Fixed +- Rollback coroutines to 1.6.1 ### Security diff --git a/build.gradle.kts b/build.gradle.kts index 1566a36..690e4d3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,7 @@ plugins { alias(libs.plugins.changelog) alias(libs.plugins.dokka) - //alias(libs.plugins.kotlin.jvm) apply false + alias(libs.plugins.kotlin.jvm) `java-gradle-plugin` `kotlin-dsl` `maven-publish` @@ -32,7 +32,7 @@ dependencies { implementation(libs.changelog.gradle) implementation(libs.dokka.gradle) implementation(libs.kotlin.jupyter.gradle) - //implementation(libs.kotlin.serialization) + implementation(libs.kotlin.serialization) implementation(libs.kotlinx.html) implementation("org.tomlj:tomlj:1.0.0") // // nexus publishing plugin diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5da12c1..320fc4a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,7 +8,7 @@ dokka = "1.6.21" kotlin-jupyter = "0.11.0-106" kotlinx-benchmark = "0.4.2" kotlinx-cli = "0.3.4" -kotlinx-coroutines = "1.6.2" +kotlinx-coroutines = "1.6.1" kotlinx-datetime = "0.3.3" kotlinx-html = "0.7.5" kotlinx-knit = "0.4.0" diff --git a/src/main/kotlin/ru/mipt/npm/gradle/KScienceExtension.kt b/src/main/kotlin/ru/mipt/npm/gradle/KScienceExtension.kt index 4654e55..c255d4a 100644 --- a/src/main/kotlin/ru/mipt/npm/gradle/KScienceExtension.kt +++ b/src/main/kotlin/ru/mipt/npm/gradle/KScienceExtension.kt @@ -50,11 +50,18 @@ public class KScienceExtension(public val project: Project) { version: String = KScienceVersions.coroutinesVersion, sourceSet: DependencySourceSet = DependencySourceSet.MAIN, configuration: DependencyConfiguration = DependencyConfiguration.API, - ): Unit = project.useCommonDependency( - "org.jetbrains.kotlinx:kotlinx-coroutines-core:$version", - dependencySourceSet = sourceSet, - dependencyConfiguration = configuration - ) + ): Unit { + project.useCommonDependency( + "org.jetbrains.kotlinx:kotlinx-coroutines-core:$version", + dependencySourceSet = sourceSet, + dependencyConfiguration = configuration + ) + project.useCommonDependency( + "org.jetbrains.kotlinx:kotlinx-coroutines-test:$version", + dependencySourceSet = DependencySourceSet.TEST, + dependencyConfiguration = DependencyConfiguration.IMPLEMENTATION + ) + } /** * Use core serialization library and configure targets diff --git a/src/main/kotlin/ru/mipt/npm/gradle/commonConfigurations.kt b/src/main/kotlin/ru/mipt/npm/gradle/commonConfigurations.kt index b94d86d..e05df86 100644 --- a/src/main/kotlin/ru/mipt/npm/gradle/commonConfigurations.kt +++ b/src/main/kotlin/ru/mipt/npm/gradle/commonConfigurations.kt @@ -36,7 +36,6 @@ public fun Project.configureKScience( dependencies { implementation(kotlin("test-junit5")) implementation("org.junit.jupiter:junit-jupiter:${KScienceVersions.junit}") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${KScienceVersions.coroutinesVersion}") } } @@ -82,7 +81,6 @@ public fun Project.configureKScience( sourceSets["test"].apply { dependencies { implementation(kotlin("test-js")) - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${KScienceVersions.coroutinesVersion}") } } @@ -124,7 +122,6 @@ public fun Project.configureKScience( dependencies { implementation(kotlin("test-common")) implementation(kotlin("test-annotations-common")) - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${KScienceVersions.coroutinesVersion}") } } val jvmMain by getting -- 2.34.1