From 9dc30d65994a0da5a15004791b7201cb1390c0da Mon Sep 17 00:00:00 2001 From: Lorenzo Bettini Date: Mon, 17 Apr 2023 20:30:16 +0200 Subject: [PATCH] Jenkinsfile with parameter for tycho-version overriding it to 2.7.5 when we build with Java 11 --- Jenkinsfile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ba3637603a0..b314d470efd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,7 +62,7 @@ pipeline { } steps { xvnc(useXauthority: true) { - sh "./full-build.sh --tp=${selectedTargetPlatform()}" + sh "./full-build.sh --tp=${selectedTargetPlatform()} ${javaVersionBasedProperties()}" } }// END steps } // END stage @@ -162,3 +162,19 @@ def selectedTargetPlatform() { } } +/** + * Tycho 3 requires Java 17. + * If the build uses Java version 11, we return the proper tycho-version override. + * Otherwise, we return an empty string. + */ +def javaVersionBasedProperties() { + def javaVersion = javaVersion() + + if (javaVersion<17) { + println("Switching to Tycho 2.7.5 with Java ${javaVersion}") + return '-Dtycho-version=2.7.5' + } else { + return '' + } +} +