https://kotlinlang.org logo
#announcements
Title
# announcements
b

billybong

05/18/2017, 1:29 PM
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

dessens

05/18/2017, 1:36 PM
billybong: What kind of issues are you having?
b

billybong

05/18/2017, 1:40 PM
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

dessens

05/18/2017, 1:41 PM
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

billybong

05/18/2017, 1:43 PM
Yup, IntelliJ sees them fine. But when it comes to Gradle builds CompileKotlin always fail
how’s your gradle setup?
d

dessens

05/18/2017, 1:44 PM
one sec
let me remove proprietary stuff
b

billybong

05/18/2017, 1:45 PM
great, lots of thanks
a

Andreas Sinz

05/18/2017, 1:50 PM
@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

billybong

05/18/2017, 1:51 PM
dessens, do you have your Kotlin and Java code in the same source folders in the same module? I.e. src/main/java ?
d

dessens

05/18/2017, 1:52 PM
no
everything is separated
b

billybong

05/18/2017, 1:53 PM
as in separate modules?
or source folder? /src/main/java /src/main/kotlin?
d

dessens

05/18/2017, 1:54 PM
yes, i tend to use a lot of subprojects
b

billybong

05/18/2017, 1:54 PM
ok, then that’s the reason it works then. They get compiled separately
d

dessens

05/18/2017, 1:58 PM
yea, sorry if that doesn't help
also, thanks for bringing this to my attention. had no idea this was an issue
a

Andreas Sinz

05/18/2017, 2:00 PM
@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

billybong

05/18/2017, 2:01 PM
ah, thanks Andreas. Thats probably a great fix for the moment. @dessens your’e welcome and thanks for your time