Skip to content

Commit 2df0892

Browse files
authored
Update Kotlin to 1.9.21 (#493)
* Update Kotlin to 1.9.21 * Remove browser from js and wasmJs * Update yarn.lock* Don't run WASM tests on Windows - WASM tests still need an alpha version of node, and those aren't available for Windows
1 parent ae460bd commit 2df0892

12 files changed

Lines changed: 66 additions & 53 deletions

File tree

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
gradle-{{ checksum ".circleci/gradle_cache_seed" }}-{{ checksum
9898
".circleci/config.yml" }}-windows
9999
- run:
100-
command: ./gradlew --no-daemon build
100+
command: ./gradlew --no-daemon build -x wasmNodeTest
101101
shell: bash.exe
102102
- save_cache:
103103
paths:
@@ -132,4 +132,4 @@ workflows:
132132
context: opensource-maven
133133
filters:
134134
branches:
135-
only: main
135+
only: main

assertk/build.gradle.kts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
12
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
23
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.common
34
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.wasm
@@ -22,14 +23,23 @@ kotlin {
2223
withJava()
2324
}
2425

26+
@OptIn(ExperimentalKotlinGradlePluginApi::class)
27+
applyDefaultHierarchyTemplate {
28+
group("coroutines") {
29+
withNative()
30+
withJs()
31+
withJvm()
32+
}
33+
}
34+
2535
sourceSets {
2636
commonMain {
2737
dependencies {
2838
implementation(libs.opentest4k)
2939
}
3040
kotlin.srcDir(compileTemplates)
3141
}
32-
val commonTest by getting {
42+
commonTest {
3343
dependencies {
3444
implementation(kotlin("test"))
3545
}
@@ -46,20 +56,11 @@ kotlin {
4656
}
4757
}
4858

49-
val coroutinesTest by creating {
50-
dependsOn(commonTest)
59+
val coroutinesTest by getting {
5160
dependencies {
5261
implementation(libs.kotlinx.coroutines)
5362
implementation(libs.kotlinx.coroutines.test)
5463
}
5564
}
5665
}
57-
58-
targets.configureEach {
59-
if (platformType != common && platformType != wasm) {
60-
compilations.getByName("test")
61-
.defaultSourceSet
62-
.dependsOn(sourceSets.getByName("coroutinesTest"))
63-
}
64-
}
6566
}
File renamed without changes.

assertk/src/wasmMain/kotlin/assertk/ThreadLocalRef.kt renamed to assertk/src/wasmJsMain/kotlin/assertk/ThreadLocalRef.kt

File renamed without changes.

assertk/src/wasmMain/kotlin/assertk/assertions/support/support.kt renamed to assertk/src/wasmJsMain/kotlin/assertk/assertions/support/support.kt

File renamed without changes.
File renamed without changes.
File renamed without changes.

assertk/src/wasmTest/kotlin/test/assertk/exceptionName.kt renamed to assertk/src/wasmJsTest/kotlin/test/assertk/exceptionName.kt

File renamed without changes.
File renamed without changes.

buildSrc/src/main/kotlin/assertk.multiplatform.gradle.kts

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import io.gitlab.arturbosch.detekt.Detekt
2+
import org.apache.tools.ant.taskdefs.condition.Os
23
import org.gradle.accessors.dm.LibrariesForLibs
34
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
4-
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
55
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithTests
6+
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
7+
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
8+
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
9+
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask
10+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
611

712
plugins {
813
kotlin("multiplatform")
@@ -27,16 +32,6 @@ if (libs.versions.assertk.get().endsWith("SNAPSHOT")) {
2732
}
2833
}
2934

30-
val nativeTargets = arrayOf(
31-
"linuxX64", "linuxArm64",
32-
"macosX64", "macosArm64",
33-
"mingwX64",
34-
"iosArm32", "iosArm64", "iosX64", "iosSimulatorArm64",
35-
"tvosArm64", "tvosX64", "tvosSimulatorArm64",
36-
"watchosArm32", "watchosArm64", "watchosX86", "watchosX64", "watchosSimulatorArm64", "watchosDeviceArm64",
37-
"androidNativeArm32", "androidNativeArm64", "androidNativeX86", "androidNativeX64",
38-
)
39-
4035
kotlin {
4136
jvm()
4237
js {
@@ -50,33 +45,32 @@ kotlin {
5045
}
5146
// TODO Remove conditional once coroutines ships a version with WASM target.
5247
if (project.path != ":assertk-coroutines") {
53-
wasm {
48+
@OptIn(ExperimentalWasmDsl::class)
49+
wasmJs {
5450
nodejs()
5551
}
5652
}
5753

58-
for (target in nativeTargets) {
59-
targets.add(presets.getByName(target).createTarget(target))
60-
}
61-
62-
sourceSets {
63-
val commonMain by getting
64-
val commonTest by getting
65-
val nativeMain = create("nativeMain") {
66-
dependsOn(commonMain)
67-
}
68-
val nativeTest = create("nativeTest") {
69-
dependsOn(commonTest)
70-
}
71-
for (sourceSet in nativeTargets) {
72-
getByName("${sourceSet}Main") {
73-
dependsOn(nativeMain)
74-
}
75-
getByName("${sourceSet}Test") {
76-
dependsOn(nativeTest)
77-
}
78-
}
79-
}
54+
linuxX64()
55+
linuxArm64()
56+
macosX64()
57+
macosArm64()
58+
mingwX64()
59+
iosArm64()
60+
iosX64()
61+
iosSimulatorArm64()
62+
tvosArm64()
63+
tvosX64()
64+
tvosSimulatorArm64()
65+
watchosArm32()
66+
watchosArm64()
67+
watchosX64()
68+
watchosSimulatorArm64()
69+
watchosDeviceArm64()
70+
androidNativeArm32()
71+
androidNativeArm64()
72+
androidNativeX86()
73+
androidNativeX64()
8074
}
8175

8276
tasks.withType<KotlinJvmCompile> {
@@ -130,3 +124,21 @@ val detektTest by tasks.registering(Detekt::class) {
130124
val detekt by tasks.getting {
131125
dependsOn(detektMain, detektTest)
132126
}
127+
128+
// Node doesn't publish alpha versions for windows
129+
if(!Os.isFamily(Os.FAMILY_WINDOWS)) {
130+
rootProject.the<NodeJsRootExtension>().apply {
131+
nodeVersion = "22.0.0-v8-canary20231127cbafc81f11"
132+
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
133+
}
134+
}
135+
136+
rootProject.tasks.withType<KotlinNpmInstallTask>().configureEach {
137+
args.add("--ignore-engines")
138+
}
139+
140+
tasks.withType<KotlinCompilationTask<*>>().configureEach {
141+
compilerOptions {
142+
freeCompilerArgs.add("-Xexpect-actual-classes")
143+
}
144+
}

0 commit comments

Comments
 (0)