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 a32af03
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
21 changes: 21 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@

import com.github.gradle.node.NodeExtension
import com.github.gradle.node.NodePlugin
import dev.petuska.npm.publish.NpmPublishPlugin
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
import org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper

buildscript {
dependencies {
Expand All @@ -22,6 +25,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 +212,20 @@ 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")
}
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 a32af03

Please sign in to comment.