[Gradle, Wasm] Use separate hierarchical methods for JS and wasi
^KT-63417 fixed
This commit is contained in:
committed by
Space Team
parent
dcab981ee8
commit
94ce4c06a7
@@ -944,6 +944,8 @@ public abstract interface class org/jetbrains/kotlin/gradle/plugin/KotlinHierarc
|
||||
public abstract fun withTvosX64 ()V
|
||||
public abstract fun withWasm ()V
|
||||
public abstract fun withWasm32 ()V
|
||||
public abstract fun withWasmJs ()V
|
||||
public abstract fun withWasmWasi ()V
|
||||
public abstract fun withWatchos ()V
|
||||
public abstract fun withWatchosArm32 ()V
|
||||
public abstract fun withWatchosArm64 ()V
|
||||
|
||||
+3
@@ -137,7 +137,10 @@ interface KotlinHierarchyBuilder {
|
||||
|
||||
/* Actual targets */
|
||||
fun withJs()
|
||||
@Deprecated("Renamed to 'withWasmJs''", replaceWith = ReplaceWith("withWasmJs()"))
|
||||
fun withWasm()
|
||||
fun withWasmJs()
|
||||
fun withWasmWasi()
|
||||
fun withJvm()
|
||||
|
||||
@Deprecated("Renamed to 'withAndroidTarget''", replaceWith = ReplaceWith("withAndroidTarget()"))
|
||||
|
||||
+11
-1
@@ -8,6 +8,8 @@ package org.jetbrains.kotlin.gradle.plugin.hierarchy
|
||||
import org.gradle.api.InvalidUserCodeException
|
||||
import org.jetbrains.kotlin.gradle.plugin.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.*
|
||||
import org.jetbrains.kotlin.gradle.targets.js.KotlinWasmTargetType
|
||||
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTarget
|
||||
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
|
||||
import org.jetbrains.kotlin.konan.target.DEPRECATED_TARGET_MESSAGE
|
||||
import org.jetbrains.kotlin.konan.target.Family
|
||||
@@ -148,7 +150,15 @@ private class KotlinHierarchyBuilderImpl(
|
||||
// Don't check for instance of [KotlinJsTargetDsl] or [KotlinWasmTargetDsl] because they are implemented by single target [KotlinJsIrTarget]
|
||||
override fun withJs() = withTargets { it.platformType == KotlinPlatformType.js }
|
||||
|
||||
override fun withWasm() = withTargets { it.platformType == KotlinPlatformType.wasm }
|
||||
override fun withWasm() = withWasmJs()
|
||||
|
||||
override fun withWasmJs() = withTargets {
|
||||
it.platformType == KotlinPlatformType.wasm && it is KotlinJsIrTarget && it.wasmTargetType == KotlinWasmTargetType.JS
|
||||
}
|
||||
|
||||
override fun withWasmWasi() = withTargets {
|
||||
it.platformType == KotlinPlatformType.wasm && it is KotlinJsIrTarget && it.wasmTargetType == KotlinWasmTargetType.WASI
|
||||
}
|
||||
|
||||
override fun withJvm() = withTargets {
|
||||
it is KotlinJvmTarget ||
|
||||
|
||||
+2
-2
@@ -319,7 +319,7 @@ class KotlinHierarchyDslTest {
|
||||
common {
|
||||
group("web") {
|
||||
withJs()
|
||||
withWasm()
|
||||
withWasmJs()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -347,7 +347,7 @@ class KotlinHierarchyDslTest {
|
||||
withJvm()
|
||||
}
|
||||
group("wasmAndLinux") {
|
||||
withWasm()
|
||||
withWasmJs()
|
||||
withLinuxX64()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user