Hi guys! Hello from China. I'm new to kotlin but I...
# announcements
t
Hi guys! Hello from China. I'm new to kotlin but I want to migrate small project from java to kotlin. Thing is that annotation base code geneation is used there. That code generator is written by me and it works ok with java sources and now I want to upgrade it a bit. I want it to be able to work both with java and kotlin source. What should I start with, maybe you can suggest me articles/examples to look for?
l
With IDEA the easiest way is to Copy a Java file and paste in a new Kotlin file. It will prompt to convert to Kotlin; it won't always succeed, but you'll learn a lot in the process. I migrated a small Java project just for fun doing exactly that: https://github.com/leus/accounting
g
You annotation processor and code generation should work with Kotlin, just use Kapt to run it https://kotlinlang.org/docs/reference/kapt.html
What is build system of your project?