diff options
author | Philippe Perrin <philippe.perrin@sonarsource.com> | 2021-10-06 11:03:37 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-10-07 20:03:21 +0000 |
commit | 6847a3b6f9b05ac53c32b628a5875f70ca0cfa15 (patch) | |
tree | 45fd5fb144537c3332c6a60f27b00cb55d85a4a4 /build.gradle | |
parent | fea5cec5eb9b26cbf42f98f6ef79a8e01028af0e (diff) | |
download | sonarqube-6847a3b6f9b05ac53c32b628a5875f70ca0cfa15.tar.gz sonarqube-6847a3b6f9b05ac53c32b628a5875f70ca0cfa15.zip |
Fix issues with yarn install parallelization when no cache are available
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/build.gradle b/build.gradle index a61f58fe0e2..844fb69c1f3 100644 --- a/build.gradle +++ b/build.gradle @@ -655,6 +655,15 @@ gradle.projectsEvaluated { gradle -> allprojects .findResults { it -> it.tasks.findByName('dependencyCheckAggregate_prerequisites') } .each { t -> dependencyCheckAggregate.dependsOn(t) } + + // yarn_run tasks can't all run in parallel without yarn's global cache being populated + // this script add a dependency on all yarn_run tasks to the sonar-web yarn_run task + // this way we are sure that the yarn global cache is available and populated before running the + // rest of the yarn_run tasks in parrallel + def yarnRunTasks = allprojects.findResults { it -> it.tasks.findByName('yarn_run') } + def sonarWebyarnRunTask = yarnRunTasks.find { t -> t.project.name == 'sonar-web' } + yarnRunTasks.remove(sonarWebyarnRunTask) + yarnRunTasks.each { t -> t.mustRunAfter(sonarWebyarnRunTask) } } ext.osAdaptiveCommand = { commands -> |