Closed fawind closed 2 years ago
The goal of lint plugin is to keep backward compatibility. For that reason it needs to keep using Gradle 6.x as API and with that Groovy 2.x. It is possible to have a plugin compiled against older Gradle and Groovy version and use it in Gradle 7.x but not the other way.
You can see the Gradle API declaration here https://github.com/nebula-plugins/gradle-lint-plugin/blob/main/build.gradle#L62
If you are developing custom rules and they are using Gradle 7.x you need to fill the missing methods there. It is not possible to put them here because both missing methods are using classes from Groovy 3 as parameters.
It looks like in newer versions of Groovy, GroovyCodeVisitor added some additional abstract methods, e.g.
GroovyCodeVisitor#visitMethodReferenceExpression
andGroovyCodeVisitor#visitLambdaExpression
.As a result, compiling a custom lint rule fails if it not explicitly implements those methods. Example error:
This is because we don't provide a default override in
GroovyAstVisitor
yet, forcing subclasses to provide an implementation themselfes: https://github.com/nebula-plugins/gradle-lint-plugin/blob/bab4653121e793e37a7163b54b2603390b504e0d/src/main/groovy/com/netflix/nebula/lint/rule/GroovyAstVisitor.groovy#L12Note that Gradle 7.4 depends on Groovy 3.0.9 so this is blocking repos to adopt newer Gradle versions.