I am currently working on a Gradle project that has both Java and Groovy sources. I am interested in some of the language features of Kotlin and am evaluating adding it in our code base. I have a sample project created that will compile and run all tests in IntelliJ however I can’t figure out how to make everything play nice with Gradle.
I’ve tried configuring sourceSets to enable groovy joint compilation using:
sourceSets {
main {
java { srcDirs = [] }
groovy { srcDirs = [“src/main/java”] }
}
}
I’ve also played around with trying to call compile for each language. I believe what I need is something similar to how groovy compiles stubs but I can’t figure it out…
My example project is here: https://github.com/mattjohnson/why-kotlin
Any insights are appreciated.