Why does build-logic
implement convention plugins manually as opposed to just specifying it using Kotlin DSL?
#915
-
I am guessing this has something to do with performance but am curious about exact motivations behind this decision. As per the official docs, plugins are defined using gradle files. Is this the recommended approach for all apps? This would require significant investment to learn to write plugins opposed to writing it in gradle files which we are already used to. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
IIRC the performance was slightly worse with Kotlin vs Groovy, but the main motivation was probably to follow the trend of Kotlin Everywhere, especially now that Kotlin DSL is Now the Default for New Gradle Builds.
Yes, but these are just code samples:
I don't think this is necessarily true. Plugins in Kotlin just need to be declared as classes, implement the java { /*...*/ } vs extensions.configure<JavaPluginExtension> { /*...*/ } But at the same time, you can leverage Kotlin language features that are not available in Groovy. |
Beta Was this translation helpful? Give feedback.
-
#38 was the PR that switched over, at that point in time there definitely was a noticeable speed improvement in the switch. I believe there has been speed improvements made more recently, but I don't think anyone has measured those improvements on this repo. I do agree that if they were defined in |
Beta Was this translation helpful? Give feedback.
#38 was the PR that switched over, at that point in time there definitely was a noticeable speed improvement in the switch. I believe there has been speed improvements made more recently, but I don't think anyone has measured those improvements on this repo.
I do agree that if they were defined in
.gradle.kts
format, it keeps the syntax more "normal" as compared to when they are defined in.kt
files like they are now.