Skip to content

Commit

Permalink
build: fix integration between kotlin and npm-publish plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
slisson committed Dec 6, 2024
1 parent 4eeae00 commit 5db1c75
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import com.github.gradle.node.NodeExtension
import com.github.gradle.node.NodePlugin
import io.gitlab.arturbosch.detekt.Detekt
import org.gradle.kotlin.dsl.withType
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.DokkaBaseConfiguration
import org.jetbrains.dokka.gradle.DokkaTaskPartial
Expand All @@ -22,6 +23,7 @@ plugins {
alias(libs.plugins.node) apply false
alias(libs.plugins.detekt)
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.npm.publish) apply false
}

group = "org.modelix"
Expand Down Expand Up @@ -208,3 +210,21 @@ publishing {
}
}
}

// make all 'packJsPackage' tasks depend on all 'kotlinNodeJsSetup' tasks, because gradle complained about this being missing
tasks.register("setupNodeEverywhere") {
dependsOn(":bulk-model-sync-lib:kotlinNodeJsSetup")
dependsOn(":kotlin-utils:kotlinNodeJsSetup")
dependsOn(":model-api:kotlinNodeJsSetup")
dependsOn(":model-api-gen-runtime:kotlinNodeJsSetup")
dependsOn(":model-client:kotlinNodeJsSetup")
dependsOn(":model-datastructure:kotlinNodeJsSetup")
dependsOn(":model-server-api:kotlinNodeJsSetup")
dependsOn(":modelql-client:kotlinNodeJsSetup")
dependsOn(":modelql-core:kotlinNodeJsSetup")
dependsOn(":modelql-html:kotlinNodeJsSetup")
dependsOn(":modelql-typed:kotlinNodeJsSetup")
dependsOn(":modelql-untyped:kotlinNodeJsSetup")
dependsOn(":streams:kotlinNodeJsSetup")
dependsOn(":model-client:integration-tests:kotlinNodeJsSetup")
}
2 changes: 2 additions & 0 deletions model-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,5 @@ npmPublish {
}
}
}

tasks.named("packJsPackage") { dependsOn(":setupNodeEverywhere") }
2 changes: 2 additions & 0 deletions ts-model-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,5 @@ npmPublish {
}
}
}

tasks.named("packJsPackage") { dependsOn(":setupNodeEverywhere") }
2 changes: 2 additions & 0 deletions vue-model-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,5 @@ tasks.named<NpmPackTask>("packJsPackage") {
tasks.assemble {
dependsOn("packJsPackage")
}

tasks.named("packJsPackage") { dependsOn(":setupNodeEverywhere") }

0 comments on commit 5db1c75

Please sign in to comment.