Does anyone know if Android Studio is going to mak...
# compose
m
Does anyone know if Android Studio is going to make the default gradle language be kotlin at any point? It bothers me when i create a compose project (which has to be kotlin anyway, for the most part) that the gradle files are in groovy. Also the fact that it doesn't create a toml file for your dependencies bothers me too. It seems like these should be best practices and AS should get the users moving in that direction.
plus one 8
1
g
Why does it bother you to have groovy for Gradle configs? I also don't think it's related to Compose
k
Didn't I read that gradle kotlin dsl slows your gradle processes?
g
Version catalog had been promoted to stable just in the last version of Gradle, I wouldn’t expect it to be immediate default for many thousands new Android projects, though it worth to create issue on Android issue tracker with feature request
Kotlin DSL is indeed slower, especially on first run, also Android studio integration is not working with Kotlin DSL
s
“Android studio integration is not working with Kotlin DSL” may I ask for some clarification on that part? What is it that doesn’t work?
g
There are integrations like adding dependencies, changing properties values which change build.gradle, they do not work for Kotlin DSL
s
Right, yes this is true for version catalogs as well, where when I ask for the agp upgrade assistant to auto-update it fails to find the definition inside version catalogs for example. Plenty of work to be done on tooling in this area imo.
g
BTW, I wouldn’t say that allow use Kotlin DSL is wrong, or something like this, I would like to see it as option for Android Studio wizards, same for versions catalog, I wouldn’t be just “bothered” by this and instead report/+1 issue about it, those are to be honest not very critical things, also very opinionated configs, even if version catalog is recommended practice, but it’s early to talk about it when it even not supported by Intellij correctly, so you don’t want to create bad experience for new users who need stable tools with ready to use technology
Yeah, a lot of parts require work, also those parts are on different levels: Gradle Intellij Kotlin IDE plugin Android Studio
for now IDE support of version catalog in Kotlin DSL is essentially broken: https://youtrack.jetbrains.com/issue/KTIJ-19370
s
Luckily I’ve only experienced this last bug you linked in the past, or before I gradle sync, this hasn’t been an issue for me for a long time now. But agree with you in general!
g
Have it for all my projects on Idea
to be honest not a show stopper for me, but also why I will not introduce it for projects with multiple developers and for sure not as default approachj
s
I remember there was a "Generate Kotlin gradle build files (.kts)" option many months back
s
Maybe you’ve seen it in IntelliJ? There it already is an option, and has been for quite some time now.
e
FWIW I've been using Gradle Kotlin DSL in both IDEA and AS for a while now, and it's been super stable for at least a year (small things aside like the linked issue above, which doesn't break anything and has workarounds) The configuration cache pretty much eliminates the speed difference (which isn't that big of a gap anymore). But I don't think it should be the default just yet 😅
Also this would probably be better suited for #android-studio
c
From what I heard from Xav (i think he is the build system lead for studio?) he said that they want to allow choosing kts for build files but they still need to improve a bunch of areas before theyd be comforatble with it. but yeah, i think speed is a big one.
g
The configuration cache pretty much eliminates the speed difference
The only difference is not build performance (I don’t think it’s different at all) or even configuration runtime performance, but configuration time of first use and build scripts compilation on change of build.gradle file or plugins used by it So I don’t think configuration cache helped somehow in terms difference between groovy and kotlin scripts
e
There used to be a per build configuration time issue especially on larger projects.
g
I’m not aware about issue with already compiled scripts, performance should be pretty much the same, what you saying looks as configuration time issue, but I believe it’s problem only on build configs/plugins changes which cause a lot of recompilations of dependant configs But maybe I just missed this issue, but I don’t see mentions of this on related tasks which I follow on Gradle’s github
e
It's been resolved for a while now 🤷‍♂️