Set up Kotlin source directory from Gradle Kotlin DSL
When converting Android Gradle files from Groovy to Kotlin, one thing that may not be clear is how to keep Kotlin sources within
src/main/kotlin. We simply need to get the source sets by name and call
java.srcDirs() as a function call. Works like a dream!
I hope the article was useful. If you have any feedback or questions please feel free to reach out to me on Twitter.
Thanks for reading and happy coding!
Hi, I hope you enjoyed the article. I am Andrew - a builder of apps and developer tools. Articles on the blog focus on all aspects of Android and iOS development using Kotlin and Swift.
Subscribe via RSS
Want to read more?
Here are some other articles you may enjoy.
Protecting secrets in an Android project
Managing secret values in a way that doesn't make them easy to extract can be difficult. We will explore techniques we can apply to keep them out of source control and how to secure access to them.