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
This commit is contained in:
Ilya Gorbunov
2023-08-05 08:58:10 +02:00
committed by Space Team
parent 9640e32483
commit c49934160a
2 changed files with 3 additions and 11 deletions
@@ -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
)
}
@@ -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