Skip to content

Commit

Permalink
Add task dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
skydoves committed Jun 19, 2024
1 parent 3b4928b commit 85e41b6
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 39 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/publish-snapshot.yml

This file was deleted.

51 changes: 50 additions & 1 deletion orbital/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,17 @@ kotlin {
macosX64()
macosArm64()

js(IR) {
js {
browser()
nodejs {
testTask {
useMocha {
timeout = "60s"
}
}
}
binaries.executable()
binaries.library()
}

@OptIn(ExperimentalWasmDsl::class)
Expand Down Expand Up @@ -75,6 +84,7 @@ kotlin {
}

explicitApi()
applyKotlinJsImplicitDependencyWorkaround()
}

android {
Expand Down Expand Up @@ -125,3 +135,42 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
)
}
}

// 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(":orbital:jsDevelopmentLibraryCompileSync"))
dependsOn(getByPath(":orbital:jsDevelopmentExecutableCompileSync"))
dependsOn(getByPath(":orbital:jsProductionLibraryCompileSync"))
dependsOn(getByPath(":orbital:jsProductionExecutableCompileSync"))
dependsOn(getByPath(":orbital: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(":orbital:wasmJsDevelopmentLibraryCompileSync"))
dependsOn(getByPath(":orbital:wasmJsDevelopmentExecutableCompileSync"))
dependsOn(getByPath(":orbital:wasmJsProductionLibraryCompileSync"))
dependsOn(getByPath(":orbital:wasmJsProductionExecutableCompileSync"))
dependsOn(getByPath(":orbital:wasmJsTestTestDevelopmentExecutableCompileSync"))
}
named("wasmJsBrowserProductionWebpack").configure(configureWasmJs)
named("wasmJsBrowserProductionLibraryDistribution").configure(configureWasmJs)
named("wasmJsNodeProductionLibraryDistribution").configure(configureWasmJs)
}
}

0 comments on commit 85e41b6

Please sign in to comment.