I'm developing a Kotlin library for Android. I want to provide a great developer experience for both Kotlin and Java developers, but because I don't have infinite resources I need to prioritize between those.
The library is interacting with a server I control, so I can add metadata to network calls that would help me know the split of my users.
But is there a way I can know when my library is called from Java VS Kotlin?
I see in this answer that there might be a way to inspect a given class, but as the library owner I don't think I can know which class is calling my own without using reflection which would add some runtime cost. Isn't there a way to get at runtime metadata from the JVM, that would indicate if the code was compiled from Kotlin (even at the cost of false-negatives, e.g. checking if KAPT
was used at any point which would at least report some Kotlin users?)