aboutsummaryrefslogtreecommitdiffstats
path: root/build.gradle
diff options
context:
space:
mode:
authorPhilippe Perrin <philippe.perrin@sonarsource.com>2021-09-10 12:03:30 +0200
committersonartech <sonartech@sonarsource.com>2021-09-13 20:03:34 +0000
commitfe6208314e9b759a4d9dfae682d7e14416911b20 (patch)
tree605f6bc0e135c7bcff388f6d25bbaee847a55296 /build.gradle
parentaeae9f86dd1ea20bab1c62d1ecf21d4bd0b7a264 (diff)
downloadsonarqube-fe6208314e9b759a4d9dfae682d7e14416911b20.tar.gz
sonarqube-fe6208314e9b759a4d9dfae682d7e14416911b20.zip
Make yarn installs run in parallel
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle14
1 files changed, 1 insertions, 13 deletions
diff --git a/build.gradle b/build.gradle
index b2bcfc26b76..51db32308ba 100644
--- a/build.gradle
+++ b/build.gradle
@@ -645,23 +645,11 @@ subprojects {
}
}
-
-// Yarn doesn't support concurrent access to its global cache,
-// i.e. parallel execution of several "yarn install" tasks,
-// since these tasks are independent, we can establish arbitrary total order
-// to prevent their concurrent execution.
-// Note that "task1.mustRunAfter(task2)" ordering has an effect only when both
-// tasks are scheduled for execution, therefore should be established between
-// all pairs of "yarn install" tasks to define their total order and to prevent
-// their concurrent execution even in case when one or more of these tasks not
-// scheduled.
-def yarnInstallTasks = allprojects.findResults { it -> it.tasks.findByName('yarn') }
-yarnInstallTasks.drop(1).eachWithIndex { it, i -> it.mustRunAfter(yarnInstallTasks[0..i]) }
-
// by default, Yarn will update lock file if it is not up to date with "package.json"
// using option "--immutable" will disable this behavior and "yarn install" will fail if lock file is out of date
// all "yarn install" tasks should be executed with this option for reproducibility of builds
// and to prevent developers from forgetting to update lock file when they update "package.json"
+def yarnInstallTasks = allprojects.findResults { it -> it.tasks.findByName('yarn') }
yarnInstallTasks.each { it -> it.args = ['--immutable'] }
// https://github.com/ben-manes/gradle-versions-plugin