Skip to content

Commit

Permalink
Implement applyKotlinJsImplicitDependencyWorkaround
Browse files Browse the repository at this point in the history
  • Loading branch information
skydoves committed Jun 5, 2024
1 parent 63e415e commit 958ff1f
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions compose-stable-marker/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ kotlin {
}

explicitApi()
applyKotlinJsImplicitDependencyWorkaround()
}

android {
Expand All @@ -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
Expand Down

0 comments on commit 958ff1f

Please sign in to comment.