Turning off JVM annotations for Kotlin-only builds

I’m building a library in Kotlin intended for use by Kotlin and Java projects. The library makes heavy use of JVM annotations (@JvmStatic, @JvmOverloads, etc.) for compatibility with Java. I don’t want the code they generate to be present in the Kotlin version of my build. Is there a way to tell the compiler to ignore these annotations for the Kotlin-only build?

1 Like