Skip to content

Commit 930860d

Browse files
SQUASH – another small fix where @NonCPS (is now needed)
1 parent ce9b453 commit 930860d

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

.jenkins/Jenkinsfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ def pipelineProfileNames(putFirst) {
157157
return set
158158
}
159159

160+
@NonCPS
161+
def extractBuildXmlProperty(String xml, String name) {
162+
def m = xml =~ /property\s*name="${name}"\s*value="([^"]*)"/
163+
assert m, "${name} not found in build.xml"
164+
return m[0][1]
165+
}
166+
160167
@Field Map cachedTasks = null
161168

162169
def tasks() {
@@ -231,12 +238,8 @@ def tasks() {
231238

232239
// find the default JDK and the supported JDKs defined in the build.xml
233240
def build_xml = readFile(file: 'build.xml')
234-
def javaVersionDefaultMatch = (build_xml =~ /property\s*name="java\.default"\s*value="([^"]*)"/)
235-
assert javaVersionDefaultMatch, "java.default property not found in build.xml"
236-
def javaVersionDefault = javaVersionDefaultMatch[0][1]
237-
def javaVersionsSupportedMatch = (build_xml =~ /property\s*name="java\.supported"\s*value="([^"]*)"/)
238-
assert javaVersionsSupportedMatch, "java.supported property not found in build.xml"
239-
def javaVersionsSupported = javaVersionsSupportedMatch[0][1].split(',') as List
241+
def javaVersionDefault = extractBuildXmlProperty(build_xml, 'java.default')
242+
def javaVersionsSupported = extractBuildXmlProperty(build_xml, 'java.supported').split(',') as List
240243

241244
// define matrix axes
242245
def Map matrix_axes = [

0 commit comments

Comments
 (0)