Indexing classes in compile time

How to find all subclasses of some class? How to find all classes with some annotation?

Fast way is indexing. In Java I can use but in Kotlin this lib dont work.

I think, Kotlin compiler must make index of all classes in package and store this index in (This feature have Fantom.)

We are considering something aling these lines in Kotlin's reflection support

To get ClassIndex working with Kotlin classes you can now use kapt.


apply plugin: ‘kotlin-kapt’

kapt ‘org.atteo.classindex:classindex:3.4’

I’ve migrated classindex for Kotlin: matfax/klassindex