Skip to content

Commit 9e29b3a

Browse files
authored
[CI] Handle caching bwc dependencies more gracefully (#135417) (#135418)
We need to adjust the task dependencies for bwc builds not to be hardcoded. Not all bwc projects always carry a buildBwcLinuxTar task.
1 parent 35a8c5d commit 9e29b3a

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

build.gradle

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -333,18 +333,13 @@ allprojects {
333333
tasks.register('resolveAllDependencies', ResolveAllDependencies) {
334334
def ignoredPrefixes = [DistributionDownloadPlugin.ES_DISTRO_CONFIG_PREFIX, "jdbcDriver"]
335335
configs = project.configurations.matching { config -> ignoredPrefixes.any { config.name.startsWith(it) } == false }
336+
336337
if (project.path == ':') {
337338
resolveJavaToolChain = true
338-
339-
// ensure we have best possible caching of bwc builds
340-
dependsOn ":distribution:bwc:major1:buildBwcLinuxTar"
341-
dependsOn ":distribution:bwc:major2:buildBwcLinuxTar"
342-
dependsOn ":distribution:bwc:major3:buildBwcLinuxTar"
343-
dependsOn ":distribution:bwc:major4:buildBwcLinuxTar"
344-
dependsOn ":distribution:bwc:minor1:buildBwcLinuxTar"
345-
dependsOn ":distribution:bwc:minor2:buildBwcLinuxTar"
346-
dependsOn ":distribution:bwc:minor3:buildBwcLinuxTar"
347-
dependsOn ":distribution:bwc:minor4:buildBwcLinuxTar"
339+
}
340+
// ensure we have best possible caching of bwc builds
341+
if(project.path.startsWith(":distribution:bwc:")) {
342+
dependsOn project.tasks.matching { it.name == 'buildBwcLinuxTar' }
348343
}
349344
if (project.path.contains("fixture")) {
350345
dependsOn tasks.withType(ComposePull)

0 commit comments

Comments
 (0)