Building a Kotlin + Java 9 project with Gradle

前端 未结 3 1367
刺人心
刺人心 2021-02-02 13:22

I\'m fairly new to Gradle (and Java 9, to be honest), and I\'m trying to use Gradle to build a simple library project that is a mix of Java 9 and Kotlin. More in detail, there i

3条回答
  •  梦如初夏
    2021-02-02 14:24

    Solved! It was sufficient to set the kotlin compilation dir to the same dir as Java:

    compileKotlin.destinationDir = compileJava.destinationDir
    

    It works now, both with the sources in the same tree or in different trees; but with a quirk: the jar task produces a jar with all the entries duplicated. I'll work on fix this, next.

    Thanks to everyone!

提交回复
热议问题