Issue #957: Updating docker Script to Use Latest Groovy5
part of : #957
@romani Plz review: details of changes : -used static ref as was gettig this error:
Caught: groovy.lang.MissingMethodException: No signature of static method: getCliOptions for class: diff is applicable for argument types: ([Ljava.lang.String;) values: [[-l, projects-to-test-on.properties, -bc, my_check.xml, -pc, my_check.xml, -b, master, ...]]
Possible solutions: getCliOptions(java.lang.Object)
groovy.lang.MissingMethodException: No signature of static method: getCliOptions for class: diff is applicable for argument types: ([Ljava.lang.String;) values: [[-l, projects-to-test-on.properties, -bc, my_check.xml, -pc, my_check.xml, -b, master, ...]]
Possible solutions: getCliOptions(java.lang.Object)
at diff.main(diff.groovy:11)
Exited with code exit status 1
- Used picoli as clibuilder was not part of groovy core and should be used via picoli was getting some error during the import used this for ref : https://issues.apache.org/jira/browse/GROOVY-9432
- Removed Ant builder and replaced it
Can you describe a problem? What classes need to be changed? I see you refactoring in ant , not sure why we dealing with CLI builder now.
Hey @romani It's because cli builder class is not found as the import is no longer part of groovy all-jar, so we have to use picoli import if we want to use clibuilder for more refernce : https://stackoverflow.com/questions/73862425/groovy-clibuilder-class-not-exists
based on stackoverflow , such CLI class is already in groovy4 , so we can migrate to it wihout migration to groovy 5.
as we already use groovy4 images in other places, lets migrate to "info.picocli:picocli" now, test that all works. and separate PR upgrade only goovy version to 5, so we update all images in all repos just for version bump (no groovy code changes).
Does it sounds good to you ?
Hey @romani as far as I have remember we are using 3.0.21 groovy Image in the docker file which is being used in majority of the CI's, this was precisely the reason we went for 3.0.21 ( missing cli builder) and not 4.0. I understand your view, just all CLI changes and next we can go for only version bump. Yeah I can do that, but for this picoli changes must be backward compatible, let me check.
Ok It's not , info.picoli will be compatible with 4+ only, anyways we have to go for upgrading to 4.0 why not5.0 directly, or do u want to go step by step, first 4 and then 5. Let me know.
if smooth migration is not possible, ok, lets migrate to 5.0 directly. I just tried to make PRs smaller and easily to approve