From 958ff1f59ac0926216150090a5aa1762cd293184 Mon Sep 17 00:00:00 2001 From: skydoves Date: Wed, 5 Jun 2024 18:21:26 +0900 Subject: [PATCH] Implement applyKotlinJsImplicitDependencyWorkaround --- compose-stable-marker/build.gradle.kts | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/compose-stable-marker/build.gradle.kts b/compose-stable-marker/build.gradle.kts index d2d04b9..a0bcd06 100644 --- a/compose-stable-marker/build.gradle.kts +++ b/compose-stable-marker/build.gradle.kts @@ -110,6 +110,7 @@ kotlin { } explicitApi() + applyKotlinJsImplicitDependencyWorkaround() } android { @@ -125,6 +126,45 @@ android { } } +// https://youtrack.jetbrains.com/issue/KT-56025 +fun Project.applyKotlinJsImplicitDependencyWorkaround() { + tasks { + val configureJs: Task.() -> Unit = { + dependsOn(named("jsDevelopmentLibraryCompileSync")) + dependsOn(named("jsDevelopmentExecutableCompileSync")) + dependsOn(named("jsProductionLibraryCompileSync")) + dependsOn(named("jsProductionExecutableCompileSync")) + dependsOn(named("jsTestTestDevelopmentExecutableCompileSync")) + + dependsOn(getByPath(":coil:jsDevelopmentLibraryCompileSync")) + dependsOn(getByPath(":coil:jsDevelopmentExecutableCompileSync")) + dependsOn(getByPath(":coil:jsProductionLibraryCompileSync")) + dependsOn(getByPath(":coil:jsProductionExecutableCompileSync")) + dependsOn(getByPath(":coil:jsTestTestDevelopmentExecutableCompileSync")) + } + named("jsBrowserProductionWebpack").configure(configureJs) + named("jsBrowserProductionLibraryDistribution").configure(configureJs) + named("jsNodeProductionLibraryDistribution").configure(configureJs) + + val configureWasmJs: Task.() -> Unit = { + dependsOn(named("wasmJsDevelopmentLibraryCompileSync")) + dependsOn(named("wasmJsDevelopmentExecutableCompileSync")) + dependsOn(named("wasmJsProductionLibraryCompileSync")) + dependsOn(named("wasmJsProductionExecutableCompileSync")) + dependsOn(named("wasmJsTestTestDevelopmentExecutableCompileSync")) + + dependsOn(getByPath(":coil:wasmJsDevelopmentLibraryCompileSync")) + dependsOn(getByPath(":coil:wasmJsDevelopmentExecutableCompileSync")) + dependsOn(getByPath(":coil:wasmJsProductionLibraryCompileSync")) + dependsOn(getByPath(":coil:wasmJsProductionExecutableCompileSync")) + dependsOn(getByPath(":coil:wasmJsTestTestDevelopmentExecutableCompileSync")) + } + named("wasmJsBrowserProductionWebpack").configure(configureWasmJs) + named("wasmJsBrowserProductionLibraryDistribution").configure(configureWasmJs) + named("wasmJsNodeProductionLibraryDistribution").configure(configureWasmJs) + } +} + java { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11