Skip to content

Commit

Permalink
Yarn cache-redirector only for root project
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 47cc013 commit edf7b9c
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -741,15 +741,17 @@ tasks {
val coreLibsPublishable = coreLibProjects + listOf(":kotlin-stdlib-common")
val coreLibsBuildable = coreLibProjects + listOf(":kotlin-stdlib-jvm-minimal-for-test", ":kotlin-stdlib-js-ir-minimal-for-test")

aggregateLibsTask("coreLibsClean", "clean",
aggregateLibsTask(
"coreLibsClean", "clean",
(coreLibProjects + coreLibsBuildable + coreLibsPublishable).distinct() +
":kotlin-stdlib:samples"
":kotlin-stdlib:samples"
)

aggregateLibsTask("coreLibsAssemble", "assemble", coreLibsBuildable)
aggregateLibsTask("coreLibsInstall", "install", coreLibsPublishable)
aggregateLibsTask("coreLibsPublish", "publish", coreLibsPublishable)
aggregateLibsTask("coreLibsTest", "check",
aggregateLibsTask(
"coreLibsTest", "check",
coreLibsBuildable + listOfNotNull(
":kotlin-stdlib:samples",
":kotlin-test:kotlin-test-js-it".takeIf { !kotlinBuildProperties.isInJpsBuildIdeaSync },
Expand Down Expand Up @@ -1164,17 +1166,12 @@ plugins.withType(com.github.gradle.node.NodePlugin::class) {
}
}

@Suppress("DEPRECATION")
afterEvaluate {
if (kotlinBuildProperties.isCacheRedirectorEnabled) {
allprojects {
plugins.withType(org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin::class.java) {
the<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootEnvSpec>().downloadBaseUrl =
"https://cache-redirector.jetbrains.com/github.com/yarnpkg/yarn/releases/download"
}
}

rootProject.plugins.withType(org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin::class.java) {
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootEnvSpec>().downloadBaseUrl =
"https://cache-redirector.jetbrains.com/github.com/yarnpkg/yarn/releases/download"

rootProject.the<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension>().yarnLockMismatchReport =
YarnLockMismatchReport.WARNING
}
Expand Down

0 comments on commit edf7b9c

Please sign in to comment.