Skip to content

Commit

Permalink
Use convention plugin for nodejs configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgonmic authored and qodana-bot committed Nov 19, 2024
1 parent be7b03c commit 47cc013
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 10 deletions.
11 changes: 1 addition & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ plugins {
}
`jvm-toolchains`
alias(libs.plugins.gradle.node) apply false
id("nodejs-cache-redirector-configuration")
}

val isTeamcityBuild = project.kotlinBuildProperties.isTeamcityBuild
Expand Down Expand Up @@ -1147,16 +1148,6 @@ if (disableVerificationTasks) {

gradle.taskGraph.whenReady(checkYarnAndNPMSuppressed)

allprojects {
plugins.withType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsPlugin::class) {
extensions.configure(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsEnvSpec::class.java) {
if (kotlinBuildProperties.isCacheRedirectorEnabled) {
downloadBaseUrl = "https://cache-redirector.jetbrains.com/nodejs.org/dist"
}
}
}
}

plugins.withType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin::class) {
extensions.configure(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension::class.java) {
npmInstallTaskProvider.configure {
Expand Down
1 change: 1 addition & 0 deletions libraries/kotlin.test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ plugins {
kotlin("multiplatform")
`maven-publish`
signing
id("nodejs-cache-redirector-configuration")
}

description = "Kotlin Test Library"
Expand Down
1 change: 1 addition & 0 deletions libraries/kotlin.test/js/it/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {
kotlin("multiplatform")
alias(libs.plugins.gradle.node)
idea
id("nodejs-cache-redirector-configuration")
}

description = "Kotlin-test integration tests for JS"
Expand Down
1 change: 1 addition & 0 deletions libraries/stdlib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ plugins {
kotlin("multiplatform")
`maven-publish`
signing
id("nodejs-cache-redirector-configuration")
}

description = "Kotlin Standard Library"
Expand Down
1 change: 1 addition & 0 deletions libraries/stdlib/js-ir-minimal-for-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.gradle.dsl.*

plugins {
kotlin("multiplatform")
id("nodejs-cache-redirector-configuration")
}

kotlin {
Expand Down
1 change: 1 addition & 0 deletions plugins/atomicfu/atomicfu-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description = "Runtime library for the Atomicfu compiler plugin"
plugins {
kotlin("js")
`maven-publish`
id("nodejs-cache-redirector-configuration")
}

group = "org.jetbrains.kotlin"
Expand Down
1 change: 1 addition & 0 deletions plugins/js-plain-objects/runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description = "Runtime library for the JS Plain Objects compiler plugin"
plugins {
kotlin("js")
`maven-publish`
id("nodejs-cache-redirector-configuration")
}

group = "org.jetbrains.kotlin"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsEnvSpec
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsPlugin

plugins.withType(NodeJsPlugin::class) {
extensions.configure(NodeJsEnvSpec::class.java) {
if (kotlinBuildProperties.isCacheRedirectorEnabled) {
downloadBaseUrl = "https://cache-redirector.jetbrains.com/nodejs.org/dist"
}
}
}

0 comments on commit 47cc013

Please sign in to comment.