I would like to convert build.gradle
files in my Android projects from Groovy to Kotlin using Gradle Script Kotlin. Preferably I'd like all of them in Kotlin, but if there are some limitations then as much as possible.
Lets assume I have just an empty project, freshly created from an Android Studio "New application" template (minSdkVersion 15
, using AppCompat if that matters). What steps do I need to take for such project to convert it to Gradle Script Kotlin.
I hope this should be a great starting point for me (and everybody else) and I can can handle converting any custom logic I have on my own.
iml files inside your project. Launch Android Studio, and click File > New > Import Project. Locate your project directory, click the build. gradle file you created above to select it, and then click OK to import your project.
Gradle is a build system that is very commonly used in the Java, Android, and other ecosystems. It is the default choice for Kotlin/Native and Multiplatform when it comes to build systems.
there's already an hello-android
example which descibe how to do it.
Check: https://github.com/gradle/gradle-script-kotlin/tree/master/samples/hello-android
Note that:
It has been tested against Android Studio 2.2 Preview 6 with the latest Kotlin plugin from the EAP 1.1 channel.
Read also: https://github.com/gradle/gradle-script-kotlin/issues/2
Hope it will help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With