diff options
author | Philippe Perrin <philippe.perrin@sonarsource.com> | 2021-09-28 14:12:55 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-09-28 20:03:12 +0000 |
commit | 4024058c7b8ef575b317f97c66fbc1bffbb89349 (patch) | |
tree | b941a30ee479bd62710dbdad236d22e125277aae | |
parent | bd8113fc93cbb4b601bfbe3dd751093e1b4d95e2 (diff) | |
download | sonarqube-4024058c7b8ef575b317f97c66fbc1bffbb89349.tar.gz sonarqube-4024058c7b8ef575b317f97c66fbc1bffbb89349.zip |
Revert "Avoid unnecessary yarn install runs"
This reverts commit 8e37a6b5f7e0495cdb16ea5ad5113b00560b86d8.
-rw-r--r-- | build.gradle | 33 | ||||
-rw-r--r-- | server/sonar-docs/build.gradle | 7 | ||||
-rw-r--r-- | server/sonar-web/build.gradle | 7 |
3 files changed, 0 insertions, 47 deletions
diff --git a/build.gradle b/build.gradle index 6c4d916ca5d..4c67c8dd4d8 100644 --- a/build.gradle +++ b/build.gradle @@ -666,36 +666,3 @@ dependencyUpdates { rejected } } - -// Hack to avoid unecessary yarn install. -// This will create a avoidInstallTask task on which both installTask & runTask will depend. -// installTask is disabled and will only be activated by avoidInstallTask when it is executed -// Because it is set to share the same dependencies, avoidInstallTask will be executed only if -// the runTask will be executed -ext.avoidYarnInstallIfPossible = { taskList, installTask, runTask -> - // Disable the yarn install task - installTask.enabled = false; - - def avoidInstallTask = taskList.register('avoidInstallTask_' + runTask.name) { - // Copy all inputs and outputs - runTask.inputs.getFiles().each { fi -> - if (fi.isDirectory()) inputs.dir(fi) - else inputs.file(fi) - } - runTask.outputs.getFiles().each { fi -> - if (fi.isDirectory()) outputs.dir(fi) - else outputs.file(fi) - } - - outputs.cacheIf { true } - - // Activate the yarn install task - doLast { - installTask.enabled = true - } - } - - runTask.dependsOn(installTask) - runTask.dependsOn(avoidInstallTask) - installTask.dependsOn(avoidInstallTask) -}
\ No newline at end of file diff --git a/server/sonar-docs/build.gradle b/server/sonar-docs/build.gradle index 01fd51bdbea..0a60cb45dd5 100644 --- a/server/sonar-docs/build.gradle +++ b/server/sonar-docs/build.gradle @@ -67,10 +67,6 @@ yarn_run { outputs.cacheIf { true } args = ['build'] } -build.dependsOn(yarn_run) - -avoidYarnInstallIfPossible(tasks, yarn, yarn_run); - // To clean outputs outside of "build" directory: clean.dependsOn(cleanYarn_run) @@ -101,15 +97,12 @@ clean.dependsOn(cleanYarn_run) dependsOn(yarn) } -avoidYarnInstallIfPossible(tasks, yarn, tasks.getByName("yarn_validate-ci")); - // Check for known vulnerabilities task dependency_audit(type: Exec) { inputs.file('package.json') outputs.cacheIf { false } commandLine 'yarn', 'npm', 'audit', '--environment', 'production', '--severity', 'high' ignoreExitValue = true - dependsOn(yarn) } diff --git a/server/sonar-web/build.gradle b/server/sonar-web/build.gradle index 92cfcac7116..3987f4f2679 100644 --- a/server/sonar-web/build.gradle +++ b/server/sonar-web/build.gradle @@ -24,13 +24,9 @@ yarn_run { outputs.dir(webappDir) outputs.cacheIf { true } args = ['build-release'] - - dependsOn(yarn) } build.dependsOn(yarn_run) -avoidYarnInstallIfPossible(tasks, yarn, yarn_run); - "yarn_check-ci" { // Note that outputs are not relocatable, because contain absolute paths, and that's why inputs are not relativized ['config', 'src'].each { @@ -58,15 +54,12 @@ avoidYarnInstallIfPossible(tasks, yarn, yarn_run); dependsOn(yarn) } -avoidYarnInstallIfPossible(tasks, yarn, tasks.getByName("yarn_validate-ci")); - // Check for known vulnerabilities task dependency_audit(type: Exec) { inputs.file('package.json') outputs.cacheIf { false } commandLine 'yarn', 'npm', 'audit', '--environment', 'production', '--severity', 'high' ignoreExitValue = true - dependsOn(yarn) } |