From c3550f9752831dd584356bd40d7112ce20ef2f37 Mon Sep 17 00:00:00 2001 From: Rene Groeschke Date: Thu, 14 Oct 2021 19:03:21 +0200 Subject: [PATCH] Cleanup BWC projects for versions bigger than 7.12 This should fix the failing release build. More cleanup on the ES build is required and will be done in a follow up PR --- ...lDistributionBwcSetupPluginFuncTest.groovy | 4 +-- .../InternalDistributionBwcSetupPlugin.java | 26 +++++++++++-------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPluginFuncTest.groovy b/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPluginFuncTest.groovy index a03f6ef8c9e79..7aa1adbc4865f 100644 --- a/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPluginFuncTest.groovy +++ b/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPluginFuncTest.groovy @@ -66,18 +66,16 @@ class InternalDistributionBwcSetupPluginFuncTest extends AbstractGitAwareGradleF """ when: def result = gradleRunner(":distribution:bwc:${bwcProject}:buildBwcDarwinTar", - ":distribution:bwc:${bwcProject}:buildBwcOssDarwinTar", + ":distribution:bwc:${bwcProject}:buildBwcDarwinTar", "-DtestRemoteRepo=" + remoteGitRepo, "-Dbwc.remote=origin", "-Dbwc.dist.version=${bwcDistVersion}-SNAPSHOT") .build() then: result.task(":distribution:bwc:${bwcProject}:buildBwcDarwinTar").outcome == TaskOutcome.SUCCESS - result.task(":distribution:bwc:${bwcProject}:buildBwcOssDarwinTar").outcome == TaskOutcome.SUCCESS and: "assemble task triggered" assertOutputContains(result.output, "[$bwcDistVersion] > Task :distribution:archives:darwin-tar:${expectedAssembleTaskName}") - assertOutputContains(result.output, "[$bwcDistVersion] > Task :distribution:archives:oss-darwin-tar:${expectedAssembleTaskName}") where: bwcDistVersion | bwcProject | expectedAssembleTaskName diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPlugin.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPlugin.java index 7e43dd97ca7e6..a41ce13daf24f 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPlugin.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPlugin.java @@ -166,18 +166,22 @@ private void registerDistributionArchiveArtifact(Project bwcProject, Distributio private static List resolveArchiveProjects(File checkoutDir, Version bwcVersion) { List projects = new ArrayList<>(); - // All active BWC branches publish default and oss variants of rpm and deb packages - projects.addAll(asList("deb", "rpm", "oss-deb", "oss-rpm")); - - if (bwcVersion.onOrAfter("7.0.0")) { // starting with 7.0 we bundle a jdk which means we have platform-specific archives - projects.addAll(asList("oss-windows-zip", "windows-zip", "oss-darwin-tar", "darwin-tar", "oss-linux-tar", "linux-tar")); - - // We support aarch64 for linux and mac starting from 7.12 - if (bwcVersion.onOrAfter("7.12.0")) { - projects.addAll(asList("oss-darwin-aarch64-tar", "oss-linux-aarch64-tar", "darwin-aarch64-tar", "linux-aarch64-tar")); + if (bwcVersion.onOrAfter("7.13.0")) { + projects.addAll(asList("deb", "rpm")); + projects.addAll(asList("windows-zip", "darwin-tar", "linux-tar")); + projects.addAll(asList("darwin-aarch64-tar", "linux-aarch64-tar")); + } else { + projects.addAll(asList("deb", "rpm", "oss-deb", "oss-rpm")); + if (bwcVersion.onOrAfter("7.0.0")) { // starting with 7.0 we bundle a jdk which means we have platform-specific archives + projects.addAll(asList("oss-windows-zip", "windows-zip", "oss-darwin-tar", "darwin-tar", "oss-linux-tar", "linux-tar")); + + // We support aarch64 for linux and mac starting from 7.12 + if (bwcVersion.onOrAfter("7.12.0")) { + projects.addAll(asList("oss-darwin-aarch64-tar", "oss-linux-aarch64-tar", "darwin-aarch64-tar", "linux-aarch64-tar")); + } + } else { // prior to 7.0 we published only a single zip and tar archives for oss and default distributions + projects.addAll(asList("oss-zip", "zip", "tar", "oss-tar")); } - } else { // prior to 7.0 we published only a single zip and tar archives for oss and default distributions - projects.addAll(asList("oss-zip", "zip", "tar", "oss-tar")); } return projects.stream().map(name -> {