From c49934160a198a0d8de61c8cf4979d8736241b18 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Sat, 5 Aug 2023 08:58:10 +0200 Subject: [PATCH] Remove wasm platform handling from stdlib dependency autoconfiguration Wasm variants of common kotlin-stdlib now provide the required artifacts. No support of previous versions is required due to experimental status. KT-60909, KT-59000 --- .../kotlin/gradle/KotlinSpecificDependenciesIT.kt | 3 ++- .../gradle/internal/stdlibDependencyManagement.kt | 11 +---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinSpecificDependenciesIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinSpecificDependenciesIT.kt index 9e423c5c252..1e1d5906a32 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinSpecificDependenciesIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinSpecificDependenciesIT.kt @@ -287,7 +287,8 @@ class KotlinSpecificDependenciesIT : KGPBaseTest() { project("wasm-d8-simple-project", gradleVersion) { checkTaskCompileClasspath( "compileKotlinWasmJs", - listOf("kotlin-stdlib-wasm"), + checkModulesInClasspath = listOf("kotlin-stdlib-wasm-js"), + checkModulesNotInClasspath = listOf("kotlin-stdlib-wasm-wasi"), isBuildGradleKts = true ) } diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/internal/stdlibDependencyManagement.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/internal/stdlibDependencyManagement.kt index 81f645b3119..17c729ba5cd 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/internal/stdlibDependencyManagement.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/internal/stdlibDependencyManagement.kt @@ -34,9 +34,6 @@ internal const val KOTLIN_STDLIB_MODULE_NAME = "kotlin-stdlib" internal const val KOTLIN_STDLIB_JDK7_MODULE_NAME = "kotlin-stdlib-jdk7" internal const val KOTLIN_STDLIB_JDK8_MODULE_NAME = "kotlin-stdlib-jdk8" internal const val KOTLIN_STDLIB_JS_MODULE_NAME = "kotlin-stdlib-js" -internal const val KOTLIN_STDLIB_WASM_JS_MODULE_NAME = "kotlin-stdlib-wasm-js" -internal const val KOTLIN_STDLIB_WASM_WASI_MODULE_NAME = "kotlin-stdlib-wasm-wasi" - internal const val KOTLIN_ANDROID_JVM_STDLIB_MODULE_NAME = KOTLIN_STDLIB_MODULE_NAME internal fun Project.configureStdlibDefaultDependency( @@ -149,7 +146,6 @@ private fun KotlinTarget.addStdlibDependency( // except standalone compilations which as not using 'common' if (isMppProject && stdlibVersion >= kotlin1920Version && - compilation.platformType != KotlinPlatformType.wasm && kotlinSourceSet.dependsOn.isNotEmpty() ) return@withDependencies @@ -201,12 +197,7 @@ internal fun KotlinPlatformType.stdlibPlatformType( } KotlinPlatformType.js -> if (isVersionWithGradleMetadata) KOTLIN_STDLIB_MODULE_NAME else KOTLIN_STDLIB_JS_MODULE_NAME - KotlinPlatformType.wasm -> { - when ((kotlinTarget as KotlinJsIrTarget).wasmTargetType!!) { - KotlinWasmTargetType.JS -> KOTLIN_STDLIB_WASM_JS_MODULE_NAME - KotlinWasmTargetType.WASI -> KOTLIN_STDLIB_WASM_WASI_MODULE_NAME - } - } + KotlinPlatformType.wasm -> KOTLIN_STDLIB_MODULE_NAME KotlinPlatformType.native -> null KotlinPlatformType.common -> // there's no platform compilation that the source set is default for if (isVersionWithGradleMetadata) KOTLIN_STDLIB_MODULE_NAME else KOTLIN_STDLIB_COMMON_MODULE_NAME