From 6eacd84b52bfd71b20a0437a3830422cf357b016 Mon Sep 17 00:00:00 2001 From: Rene Groeschke Date: Thu, 25 Sep 2025 11:18:44 +0200 Subject: [PATCH] [CI] Handle caching bwc dependencies more gracefully 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 d26d4d73748e4..f2c7b60742e57 100644 --- a/build.gradle +++ b/build.gradle @@ -338,18 +338,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)