Multiple Java src dirs


#1

Is there a problem with the Kotlin compiler when trying to compile against multiple Java source directories? I have a process that generates some code into a generated sources dir. Then, the Kotlin compiler runs, depending on some of this Java source code. In my Gradle project, I have the following:

sourceSets {
  main {
  java {
           srcDir ‘src/main/java’
           srcDir ‘generated/’
           srcDir ‘src/main/kotlin’
  }
  }
}


But the generated directory doesn’t seem to be getting picked up by the kotlin compiler, though it is picked up by the Java compiler.

#2

Jon,

Thank you for the report. I have opened an issue: http://youtrack.jetbrains.com/issue/KT-4393

As a workaround, please add following section to your build:

compileKotlin {
  setClasspath(getClasspath() + files(‘generated’))
}


#3

Fixed in #0.9.164