From d02cba72f01839736959114c415be733879ed577 Mon Sep 17 00:00:00 2001 From: Rene Groeschke Date: Thu, 25 Sep 2025 11:41:18 +0200 Subject: [PATCH] [CI] Handle caching bwc dependencies more gracefully (#135417) We need to adjust the task dependencies for bwc builds not to be hardcoded. Not all bwc projects always carry a buildBwcLinuxTar task. --- build.gradle | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 12485c1f8709d..4606c1e05e754 100644 --- a/build.gradle +++ b/build.gradle @@ -333,18 +333,13 @@ allprojects { tasks.register('resolveAllDependencies', ResolveAllDependencies) { def ignoredPrefixes = [DistributionDownloadPlugin.ES_DISTRO_CONFIG_PREFIX, "jdbcDriver"] configs = project.configurations.matching { config -> ignoredPrefixes.any { config.name.startsWith(it) } == false } + if (project.path == ':') { resolveJavaToolChain = true - - // ensure we have best possible caching of bwc builds - dependsOn ":distribution:bwc:major1:buildBwcLinuxTar" - dependsOn ":distribution:bwc:major2:buildBwcLinuxTar" - dependsOn ":distribution:bwc:major3:buildBwcLinuxTar" - dependsOn ":distribution:bwc:major4:buildBwcLinuxTar" - dependsOn ":distribution:bwc:minor1:buildBwcLinuxTar" - dependsOn ":distribution:bwc:minor2:buildBwcLinuxTar" - dependsOn ":distribution:bwc:minor3:buildBwcLinuxTar" - dependsOn ":distribution:bwc:minor4:buildBwcLinuxTar" + } + // ensure we have best possible caching of bwc builds + if(project.path.startsWith(":distribution:bwc:")) { + dependsOn project.tasks.matching { it.name == 'buildBwcLinuxTar' } } if (project.path.contains("fixture")) { dependsOn tasks.withType(ComposePull)