From 5db1c7551f47b4672ccc545b4ddd6773862f1ec8 Mon Sep 17 00:00:00 2001 From: slisson Date: Fri, 6 Dec 2024 10:27:26 +0100 Subject: [PATCH] build: fix integration between kotlin and npm-publish plugins --- build.gradle.kts | 20 ++++++++++++++++++++ model-client/build.gradle.kts | 2 ++ ts-model-api/build.gradle.kts | 2 ++ vue-model-api/build.gradle.kts | 2 ++ 4 files changed, 26 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index c5001d4d7e..a19814ebe7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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 @@ -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" @@ -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") +} diff --git a/model-client/build.gradle.kts b/model-client/build.gradle.kts index fac65f9aef..4dcb1fdd8f 100644 --- a/model-client/build.gradle.kts +++ b/model-client/build.gradle.kts @@ -174,3 +174,5 @@ npmPublish { } } } + +tasks.named("packJsPackage") { dependsOn(":setupNodeEverywhere") } diff --git a/ts-model-api/build.gradle.kts b/ts-model-api/build.gradle.kts index a6cff6a155..1a1d393c24 100644 --- a/ts-model-api/build.gradle.kts +++ b/ts-model-api/build.gradle.kts @@ -79,3 +79,5 @@ npmPublish { } } } + +tasks.named("packJsPackage") { dependsOn(":setupNodeEverywhere") } diff --git a/vue-model-api/build.gradle.kts b/vue-model-api/build.gradle.kts index 77ac70d5a7..529ef91756 100644 --- a/vue-model-api/build.gradle.kts +++ b/vue-model-api/build.gradle.kts @@ -134,3 +134,5 @@ tasks.named("packJsPackage") { tasks.assemble { dependsOn("packJsPackage") } + +tasks.named("packJsPackage") { dependsOn(":setupNodeEverywhere") }