Zac Sweers
01/19/2023, 7:32 PMplugins
is special-cased and you’re fairly limited what you can put in therepajatopmr
01/19/2023, 7:42 PMplugins {
id("some.custom.plugin") version "1.2.3"
}
where “some.custom.plugin” would apply the Kotlin Gradle plugin using the id, for example, “org.jetbrains.kotlin.jvm”. Seems to me this should work. If not, I sure would like to better understand why it doesn’t.Zac Sweers
01/19/2023, 7:52 PMsome.custom.plugin
has an implementation dependency on the org.jetbrains.kotlin.jvm
plugin, it can just freely apply
it under the hood. If it doesn’t, that plugin needs to be available on the classpath already (either via manually adding it to plugins or another plugin transitively bringing it in).
You can’t dynamically define the version when applying from another plugin as far as I know, it’s beholden to what is already on the classpath as defined by plugins
or your own plugin’s dependencies
You can think of the plugins block syntax like so
# Puts the kotlin jvm plugin on the classpath and applies it
kotlin("jvm") version "1.8.0"
# Same as above but doesn't apply the plugin itself. Only puts it on the classpath
kotlin("jvm") version "1.8.0" apply false
But at this point this is no longer related to Kotlin and I recommend you bring your question to the gradle community slack.pajatopmr
01/19/2023, 7:54 PM