Hello, I’ve recently started to use Gradle’s Kotlin DSL, and I’m pleasantly surprised by the progress it has made over the last few years.
One thing I noticed is that the there are two ways of specifying core Kotlin dependencies and plugins - namely:
// from https://kotlinlang.org/docs/gradle-configure-project.html
plugins {
kotlin("<...>") version "1.9.0"
}
and
// from https://docs.gradle.org/current/samples/sample_building_kotlin_applications.html#review_the_project_files
plugins {
id("org.jetbrains.kotlin.jvm") version "1.8.20"
application
}
Similar syntax exists for dependencies.
What I notice is that while the kotlin(...)
syntax is very readable and easy to remember, it is inconsistent and does not play well with features like TOML library catalogs (where we need to specify the expanded dependency coordinates). Furthermore, there is no similar support for the kotlinx
namespace.
Can we get any clarity on what are the recommendations and future plans for this? Is the kotlin(...)
syntax recommended as a style? Is it going to be deprecated one day? Can we expect to see more of these “well known” shortcuts (the others I can think about are gradleApi()
, mavenCentral()
and formerly jcenter()
)?
Thanks a lot, and keep up the good work!