Is it possible to create a build.gradle.kts file, in addition to a build.gradle file, and add any new dependencies in there? I’d like to transition from groovy to kotlin.
t
Tomasz Krakowiak
08/26/2021, 7:04 PM
I think you could import gradle build script from kotlin build script. It seems there are some issues if you try to do it other way around.
You should be able to apply one from the other with
apply(from = "")
, and I believe you can freely apply Groovy scripts to Kotlin, and vice-versa.
If applying a Kotlin script into an existing Groovy script, I believe things will continue to work as you'd expect, since Groovy is evaluated dynamically. But when using the
apply(from = "")
syntax in a Kotlin buildscript, you will not get code completion or generated accessors, etc. from any plugins or anything else declared in the other script.
👍 1
n
Nick
08/26/2021, 7:09 PM
ok
Nick
08/26/2021, 7:32 PM
awww yes that worked, thanks! The plugins block in the groovy file gave me some issues and I just had to convert that over, everything else worked. thanks guys!