I am using Jenkins 2.6 on Red Hat Linux. I want to use the following in my Jenkinsfile, but when I try, Jenkins complains bitterly. (It seems only to dislike the syntax on left-hand side of the = operator.):
def (a, b) = [6, 7]
It doesn't like Multiple Assignments it seems, yet Groovy 1.6 and later apparently support them, as per this post:
http://mrhaki.blogspot.co.uk/2009/09/groovy-goodness-multiple-assignments.html
I want to do this so that when I call a method that returns [6, 7] I can call it like this:
def (a, b) = mymethod()
def mymethod()
{
return [6, 7]
}
Can anyone tell me whether this should work in Jenkins and if so in which version of Jenkins? Or is it an unsupported feature? Or a bug?
Thanks