This message was deleted.
# community-support
s
This message was deleted.
t
No, you can't. You're declaring what you're going to use "at runtime" (in the build using that plugin), and they have to match; and typesafe accessors are generated from the "runtime" configuration (Gradle knows what's available, so it can let you access it with those helpers; within a plugin you cannot know what the actual build will actually provide).
j
could we write a KSP plugin that reads the version catalog file and generate a kotlin/java "libs" that would be available for the plugin env ?
t
But which version catalog? The one from the plugin build? It won't matter "at runtime" so… 🤷 For a
buildSrc
that could possibly use the one from the parent project (except that IIUC the settings script hasn't run already, as it could itself apply a plugin from the
buildSrc
🐔 🥚). And for included builds, the included build doesn't know which build includes it so it couldn't know which version catalog to use. Now with explicit configuration then maybe that's possible…
j
I am sharing the version catalog in between the plugins project and the main project
v
You can use my hack-around from https://github.com/gradle/gradle/issues/15383
except that IIUC the settings script hasn't run already, as it could itself apply a plugin from the buildSrc
Only in ancient versions where
buildSrc
was run first. You can not use settings plugins from
buildSrc
since Gradle 5 or so
j
I am too n00b to understand what that is doing, but I will try to read it with more time.