Has anyone a good sample how to interop Kotlin wit...
# announcements
b
Has anyone a good sample how to interop Kotlin with Lombok-generated code? I’ve scoured Google but haven’t found a definitive answer suggesting that it should or should not work. Anyone got it working by using i.e Kapt?
d
billybong: What kind of issues are you having?
b
I cant see fields generated through Lomboks @Data classes which unfortunately are everywhere in our projects
We “could” migrate these to Kotlin Data classes, but that is quite cumbersome as the automatic conversion is not 100%
d
are you using intellij idea with the lombok plugin and annotation processing turned on?
that's my setup, but im also on the EAP
actually nevermind, at home im on the EAP and at work im using the latest release
b
Yup, IntelliJ sees them fine. But when it comes to Gradle builds CompileKotlin always fail
how’s your gradle setup?
d
one sec
let me remove proprietary stuff
b
great, lots of thanks
a
@billybong its not working for a single module, see http://stackoverflow.com/a/35530223. workaround would be to put java and kotlin code in different modules https://discuss.kotlinlang.org/t/kotlin-java-lombok-interop/1442
b
dessens, do you have your Kotlin and Java code in the same source folders in the same module? I.e. src/main/java ?
d
no
everything is separated
b
as in separate modules?
or source folder? /src/main/java /src/main/kotlin?
d
yes, i tend to use a lot of subprojects
b
ok, then that’s the reason it works then. They get compiled separately
d
yea, sorry if that doesn't help
also, thanks for bringing this to my attention. had no idea this was an issue
a
@billybong as stated in stackoverflow, you could set a strict compilation order java -> kotlin to fix the problem, but then you won't be able to call kotlin from java
b
ah, thanks Andreas. Thats probably a great fix for the moment. @dessens your’e welcome and thanks for your time