Skip to content

Commit cfdda22

Browse files
committed
chore: NodeJS plugin fixes
1 parent bb0594b commit cfdda22

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

gradle/build-logic/src/main/kotlin/dev.suresh.plugin.kotlin.mpp.gradle.kts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,19 +193,20 @@ artifacts {
193193
}
194194
}
195195

196-
// Initialize Node.js and NPM extensions only once in a multi-module project
196+
// Ideally, NodeJsPlugin should be applied to the root project,
197+
// but this is a hack to apply from the kotlin.mpp convention plugin.
197198
var nodeJsEnabled: String? by rootProject.extra
198199

199200
if (nodeJsEnabled.toBoolean().not()) {
200-
rootProject.plugins.withType<NodeJsRootPlugin> {
201-
rootProject.extensions.configure<NodeJsRootExtension> {
201+
rootProject.plugins.withType<NodeJsPlugin> {
202+
rootProject.the<NodeJsEnvSpec>().apply {
202203
download = true
203204
nodeJsEnabled = "true"
204205
// version = libs.versions.nodejs.version.get()
205-
// nodeDownloadBaseUrl = "https://nodejs.org/download/nightly"
206+
// downloadBaseUrl = "https://nodejs.org/download/nightly"
206207
}
207208

208-
rootProject.extensions.configure<NpmExtension> {
209+
rootProject.the<NpmExtension>().apply {
209210
lockFileDirectory = project.rootDir.resolve("gradle/kotlin-js-store")
210211
packageLockMismatchReport = LockFileMismatchReport.WARNING
211212
packageLockAutoReplace = false

0 commit comments

Comments
 (0)