This message was deleted.
# community-support
s
This message was deleted.
p
Thanks. Why do I always get issues going deeper into Gradle mechanism? :D
v
Because no software is bug-free or feature complete and Gradle is a big mighty piece. And as uncle Ben says, with great power comes great responsibility. :-)
p
Yes, absolutely true. And I am glad to have this mighty tool :D Btw after reading some comments of you regarding this isse: the plugin block is isolated and executed in a dummy project. This also applies to the buildScript block, doesn't it? So this is the same reason why versioncatalogs are also not available, is it?
v
Yes, the buildscript block is also extracted and handled specially. Needs to be as it defines the dependencies for compiling the rest of the build script. It is the reason why my hack does not work in the plugins block, yes. The normal supported version catalogs are usable in plugins blocks without problem.
p
Okay, but now I am even more confused. "Why" can I use the normal version catalog but not the versioncatalog extension?
v
Where? In a precompiled script plugin you can use neither.
Even with my hack-around
p
In a normal/plain project without any deps/included builds
v
You do not have access to the project and it is an extension on the project
And the accessors are generated specifically so that they are available
Well up to and including 8.0 it is halfway an accident that it works in the plugins block which is also why IntelliJ shows it as error. With Gradle 8.1 it will be properly supported.
p
You do not have access to the project and it is an extension on the project
🤯 Ahhh, got it. So this is the reason why the workaround with
afterEvaluate
works accessing the extension: The script itself has no access to the project, but the action is stored and executed later with project context.
So I have to wait for 8.1 RCs (or use nightly versions) :D
v
Why?
p
With Gradle 8.1 it will be properly supported.
Or do you mean IDE support?
v
Properly supported by Gradle and thus not showing error in IDE. But besides the IDE error it is already fully working, even with it being by accident.