From 867b836d4459d0052e42183c0d999b152ff48c9c Mon Sep 17 00:00:00 2001 From: Ben Asher Date: Mon, 26 Apr 2021 16:43:54 -0700 Subject: [PATCH] Upgrade to Kotlin 1.5.0 (#78) --- build.gradle.kts | 15 +++++++++++---- gradle.properties | 2 +- .../com/autodesk/coroutineworker/Platform.kt | 2 ++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e65ccfe..9ed7135 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,11 +1,12 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMetadataTarget import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget +import org.jetbrains.kotlin.gradle.targets.js.KotlinJsTarget -val coroutinesVersion = "1.4.3" -val atomicfuVersion = "0.15.0" +val coroutinesVersion = "1.5.0-RC" +val atomicfuVersion = "0.16.1" plugins { - kotlin("multiplatform") version "1.4.32" + kotlin("multiplatform") version "1.5.0" id("org.jetbrains.dokka") version "0.10.0" id("maven-publish") id("signing") @@ -52,6 +53,12 @@ kotlin { } } + targets.withType { + val test by compilations.getting { + kotlinOptions.freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn") + } + } + // do this in afterEvaluate, when nativeMain compilation becomes available afterEvaluate { targets.withType { @@ -71,7 +78,7 @@ kotlin { } val commonTest by getting { dependencies { - implementation(kotlin("test-multiplatform")) + implementation(kotlin("test")) implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion") implementation("org.jetbrains.kotlinx:atomicfu:$atomicfuVersion") } diff --git a/gradle.properties b/gradle.properties index de2e291..ff754ca 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION=0.6.4 +VERSION=0.7.0 kotlin.mpp.enableGranularSourceSetsMetadata=true kotlin.mpp.enableCompatibilityMetadataVariant=true diff --git a/src/jsTest/kotlin/com/autodesk/coroutineworker/Platform.kt b/src/jsTest/kotlin/com/autodesk/coroutineworker/Platform.kt index e32fd09..33479ff 100644 --- a/src/jsTest/kotlin/com/autodesk/coroutineworker/Platform.kt +++ b/src/jsTest/kotlin/com/autodesk/coroutineworker/Platform.kt @@ -1,10 +1,12 @@ package com.autodesk.coroutineworker import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.promise import kotlin.coroutines.CoroutineContext +@OptIn(DelicateCoroutinesApi::class) actual fun runBlocking(context: CoroutineContext, block: suspend CoroutineScope.() -> T): dynamic = GlobalScope.promise { block() } actual fun Any.ensureNeverFrozen() = Unit