Hello,
I use groovy and java together a lot in my projects. In the past when I was using the groovy gradle DSL I had something that looked like this for my sourcesets
sourceSets {
main {
groovy.srcDirs += java.srcDirs
java.srcDirs = []
}
groovyTest {
compileClasspath = test.compileClasspath
runtimeClasspath = output + test.runtimeClasspath
groovy {
srcDir 'src/test/groovy/'
}
}
}
I have a strong desire to convert my projects over to using the kotlin dsl, but I can’t quite crack this nut. So far I have something like this, but I think it is wrong. Any advice would be very much appreciated.
sourceSets {
val groovy = convention.getPlugin(GroovySourceSet::class)
main {
groovy.groovy.srcDirs.addAll(java.srcDirs)
java.srcDirs("")
}
getByName("groovyTest") {
compileClasspath = getByName("test").compileClasspath + getByName("main").compileClasspath
runtimeClasspath = output + getByName("test").runtimeClasspath + getByName("main").runtimeClasspath
}
}