Files
openide/plugins/gradle/java/testSources/dsl/GradleProjectTest.kt
Nikita Biriukov d191022332 [gradle][groovy] IDEA-257715 make GradleDelegatesToProvider responsible for delegate resolving in Project's Closures.
Previously, GradleProjectContributor was responsible for delegate resolving in closures of several Project methods. It was a hardcoded logic: if Closure is a parameter of method foo() from class Project, then let delegate be CLASS_NAME. The new logic implemented in GradleDelegatesToProvider is more flexible. It allows determining a delegate if a called method with Closure has overloaded method with Action<? super AnyDelegateClass>. It covers almost all the cases supported by GradleProjectContributor, and gets triggered before it. So all covered cases were removed from there, except the delegate resolving for Project#configure(...) method.

Project#configure(...) has a version with Action<? super T> parameter, but it's not possible to surely resolve T if the version of this method with Closure was called.

This commit also has tests covering considered cases for Project.

GitOrigin-RevId: e1088ad60a61868856aca4dc0b8e943bc7e04e5f
2024-04-03 15:38:36 +00:00

6.8 KiB