The java syntax works, but one still has to
a) compile it with a groovy compiler (you have the JavaPlugin.java also under src/main/groovy)
b) call the getConventionMapping() method with reflection, is that right?
No, you don’t need to do anything special.
After switching to Java compiler, it still went red, as this method is not there, you probably add it with some groovy magic.
The method is added dynamically at runtime. You need to cast the object to IConventionAware.
Should I take the words of the original starter of this topic as truth – that conventionMappings are internal and should not be depended upon by 3rd party plugin writers?
They are internal, so may change in future Gradle versions.
Maybe i’m better off evaluating all my properties in the beginnig of my @TaskAction method still… i’m quite sure the nature of our plugin (ZeroTurnaround’s JRebel integration) is such that nobody else needs to depend on our plugin in turn, so it seems it shouldn’t bother anybody whatever moment i’m gonna evaluate my stuff(?)
The problem with this approach is that it’s too late to influence incremental build or task graph building.
You may be better off using Project.afterEvaluate().