This message was deleted.
# kotlin-dsl
s
This message was deleted.
t
Essentially, we want to be able to expose something like
kotlin_version
from our plugin so that our downstream dependencies have the correct compatible version, such as:
Copy code
kotlin("plugin.spring") version kotlin_version
v
Register an extension on the project that provides the value and that the consumer then can query.
Or what I would recommend, make a version catalog that you share and can access from both projects in the case described in that SO post
t
Have a gap in my knowledge here related to extensions + kotlin.
For my precompiled plugin project, I would apply the extension to root, correct?
so ideally I'd like to be able to apply this to root project and inherited in the other plugins downstream
Copy code
val kotlin_version: String by extra

dependencies {
  implementation("org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:${kotlin_version}")
}
this pattern works for root, but not clear on how to also make this available when using the plugins
ideally being able to just set the versions in
gradle.properties
to make the version catalog
v
I said extension, not extra property. Extra properties are practically always a dirty work-around instead of doing it properly. Typically you would add the extension wherever you apply your convention plugin and there can use it. But again, as this is about versions, dependencies, and plugins, I strongly recommend you have a look at version catalogs, where you also could use the same file in the main build and a build logic project to share the same values. You could even publish a version catalog and then user it similar to a dependency in multiple otherwise unrelated builds.
t
I see, researching