Good morning. I noticed that a good number of publ...
# community-support
j
Good morning. I noticed that a good number of public-facing methods that accept Closures aren't annotated with
@DelegatesTo
and/or
@ClosureParams
. Is there a good reason for this or is this just a result of how long Gradle has been around? And would you be open to contributions that add these annotations? I'd appreciate the additional IDE support.
m
There are different reasons, but in a nutshell: • no
Closure
taking method has been added in Gradle for years: they take
Action
and the closure version is generated • the
Closure
taking methods have been slowly removed, the ones which are left are there because they are incompatible with the
Action
change or cause API breaking change • if I remember the remaining
Closure
methods accept different kind of arguments which make it difficult if ever possible to use
@DelegatesTo
because the delegate type can be whatever
šŸ‘ 1
j
Ok, removing the
Closure
accepting methods is a good alternative since Groovy knows how to deal with
Action
. What examples of methods that accept closures are incompatible?
m
I don't have that in mind, I don't remember, last time I was on that it was several years ago šŸ˜„
j
Understandable šŸ˜