Intellij support for gradle plugin Property / Provider pattern?

Answered

I have developed a number of gradle plugins over the years and I now have a question about idea gradle support and specifically support in the build.gradle file for custom gradle plugins (or really, just support for gradle plugins in general). As per later version of the gradle docs, you should use the gradle Property/Provider pattern when defining your plugin extensions (i.e. this https://docs.gradle.org/current/userguide/lazy_configuration.html#connecting_properties_together), but when you do this, intellij complains about properties being private and not able to assign to them. Should be noted that there is no problem actually executing the build from the command line or the intellij gradle build integration, but it certainly looks bad when viewing the build.gradle file. 

Sample screen of the issue: 

 

This is with gradle 6.5 (latest), latest intellij: 

----

IntelliJ IDEA 2020.1.2 (Ultimate Edition)
Build #IU-201.7846.76, built on June 1, 2020
Licensed to Matias Bjarland
Subscription is active until February 4, 2021
Runtime version: 11.0.7+10-b765.53 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.4.0-26-generic
GC: ParNew, ConcurrentMarkSweep
Memory: 8129M
Cores: 8
Non-Bundled Plugins: com.cursiveclojure.cursive, com.intellij.lang.jsgraphql
Current Desktop: ubuntu:GNOME

----

and java 8 252 set as the gradle jdk. 

For clarity, we are here viewing a build.gradle build file which has included a custom plugin. The custom plugin defines what gradle calls a "plugin extension" which is the "buildVersionClass { ... }" block. The link to the gradle docs above describes how this block is exposed by gradle. 

Should be noted that with the latest version of gradle, if you do plugin extension properties "the old way" when developing a gradle plugin, the gradle build will actually warn you (and if I don't misremember tell you that this will stop working in gradle 7) and tell you to use the new pattern. 

As this is the recommended pattern for any future gradle plugin development and intellij does not seem to understand it (and please correct me here if there is a way to make it understand it), I would classify this a fairly major issue for the intellij gradle support. 

2
1 comment

Thank you for detailed description! Unfortunately it is a bug. Please vote and follow this issue in our tracker: https://youtrack.jetbrains.com/issue/IDEA-212386

0

Please sign in to leave a comment.