Skip to content

Commit

Permalink
Jenkinsfile with parameter for tycho-version
Browse files Browse the repository at this point in the history
overriding it to 2.7.5 when we build with Java 11
  • Loading branch information
LorenzoBettini committed Apr 18, 2023
1 parent 0be9c11 commit 9dc30d6
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ''
}
}

0 comments on commit 9dc30d6

Please sign in to comment.