Fix branch detection for Java 8/11 to build plugins
Use the native Groovy 'in' syntax for checking if the
Gerrit branch is within the list of the ones supported
for Java 8 build.
Change-Id: I621bd49b4dcb9b16905ec88850a0a10d96d1160a
diff --git a/vars/pluginPipeline.groovy b/vars/pluginPipeline.groovy
index 4d36f6a..fe46831 100644
--- a/vars/pluginPipeline.groovy
+++ b/vars/pluginPipeline.groovy
@@ -37,7 +37,7 @@
def pluginScmUrl = "https://gerrit.googlesource.com/a/${env.GERRIT_PROJECT}"
def gjfVersion = '1.7'
def javaVersion = 11
- if (["stable-2.16", "stable-3.0", "stable-3.1", "stable-3.2"].contains("${env.GERRIT_BRANCH}")) {
+ if (env.GERRIT_BRANCH in ["stable-2.16", "stable-3.0", "stable-3.1", "stable-3.2"]) {
javaVersion = 8
}
def bazeliskCmd = "#!/bin/bash\n" + ". set-java.sh ${javaVersion} && bazelisk"