Rob Elliot
08/22/2022, 1:47 PMcompileGroovyRob Elliot
08/22/2022, 1:48 PMbuild.groovytasks.named('compileGroovy') {
    // Groovy only needs the declared dependencies
    // (and not longer the output of compileJava)
    classpath = sourceSets.main.compileClasspath
}
tasks.named('compileKotlin') {
    // Kotlin also depends on the result of Groovy compilation
    // (which automatically makes it depend of compileGroovy)
    classpath += files(sourceSets.main.groovy.classesDirectory)
}
tasks.named('compileTestGroovy') {
    // Groovy only needs the declared dependencies
    // (and not longer the output of compileJava)
    classpath = sourceSets.test.compileClasspath
}
tasks.named('compileTestKotlin') {
    // Kotlin also depends on the result of Groovy compilation
    // (which automatically makes it depend of compileGroovy)
    classpath += files(sourceSets.test.groovy.classesDirectory)
}August Lilleaas
08/22/2022, 1:51 PMRob Elliot
08/22/2022, 1:53 PMRob Elliot
08/22/2022, 1:55 PMtasks.named('compileGroovy') {
    classpath = [
        sourceSets.main.compileClasspath,
        sourceSets.main.kotlin.classesDirectory
    ]
}classesDirectorysourceSets.main.kotlinVampire
08/22/2022, 1:59 PMVampire
08/22/2022, 2:01 PMVampire
08/22/2022, 2:01 PMVampire
08/22/2022, 2:15 PMRob Elliot
08/22/2022, 2:15 PMtasks.named('compileKotlin') {
    classpath = sourceSets.main.compileClasspath
}
tasks.named('compileGroovy') {
    classpath += files(sourceSets.main.kotlin.classesDirectory)
}sourceSets.main.kotlin.classesDirectoryRob Elliot
08/22/2022, 2:15 PMVampire
08/22/2022, 2:17 PM.java..kotlin.Rob Elliot
08/22/2022, 2:30 PMcompileGroovyunable to resolve class XXXbuild/classes/kotlincompileKotlinsourceSets.main.java.classesDirectoryRob Elliot
08/22/2022, 3:24 PMtasks.named('compileGroovy') {
    classpath += files(tasks.compileKotlin.destinationDir)
}Rob Elliot
08/22/2022, 3:25 PMRob Elliot
08/22/2022, 3:27 PMtasks.compileKotlin.destinationDirRob Elliot
08/22/2022, 3:31 PMtasks.named('compileGroovy') {
    classpath += files(tasks.compileKotlin.destinationDirectory)
}
tasks.named('compileTestGroovy') {
    classpath += files(tasks.compileTestKotlin.destinationDirectory)
}