This message was deleted.
# community-support
s
This message was deleted.
👀 1
m
I'd bet "no" on this one but curious about the answer
Overall included build plugins don't really care about the version, do they?
It could be
1.0.0
or
x.y.z
and it'll be in the classpath no matter what
So it deosn't really make sense to put them in a versions catalog
j
the problem is I have to remember the exact id if not as there is no codegen if it is not buildSrc, I think it is an use case which should be supported
that or remember to call get() and so on
m
I mean in all cases you need to put the id in 2 places: •
build-logic/build.gradle.kts
(
gradlePlugins {}
block) •
yourmodule/build.gradle.kts
or
libs.versions.toml
Writing this I realize if you have several modules, it's n vs 2
Could you do something like
Copy code
plugins {
  // Can build-logic contribute anything here?
  `my-plugin`
}
It's working for
kotlin-dsl
and others but maybe it's only available to a few select plugins
But I think the KGP contributes
kotlin("jvm")
so you might be able to do something ?
Copy code
fun PluginDependenciesSpec.`my-module`(): PluginDependencySpec =
    id("com.example.mymodule")
If you put that in
build-logic
maybe?
j
The problem is remember the id and/or remember to use
get().pluginId
, both are annoying, first because I always forget it, second because I have to sync two times as I can't write it without autocomplete, and I will forget it too without autocomplete 🙃 And I can't create manually the accessors if I am not using buildSrc, they fail for me, and even if that work, it lacks consistence too
Copy code
plugins {
   alias(libs.plugins.android.library)
   alias(libs.plugins.kotlin.android)
   alias(libs.plugins.my.convention)

   id(libs.plugins.my.convention.get().pluginId)
   id("my-convention")
   `my-convention` // this is crashing using an extension property over the plugin spec class
)
I think it is easier to just add it to version catalogs, but I don't understand what is the limitation to just let not setting the version in the catalog instead of Gradle trying to check if the plugin is or not in the classpath and so on, probably it exists but I would expect that under the hood it just uses
id
+
version
or just
id
based on what is defined in the
alias
+ the catalog
m
Yea agreed
We could have an alias without a version
But then we need to rename "versions catalog" to "dependencies catalog" 🧌
I think I saw a discussion about that somewhere
And "versions" was a conscious choice, not sure why
j
I have remembered this issue: https://github.com/gradle/gradle/issues/17968 and... I was there, I forgot it, that fits with I always forget it which is a general thing if I don't repeat something 1000 times 🙃
👀 1
but I think you can have libraries without versions
the limitation is only happening with plugins
I will go for this option from Vampire
• or use the settings DSL to declare the plugin without version
👍 1
tried and it doesn’t work too