The native-image plugin for Gradle works fine with Kotlin/JVM projects, i.e. Kotlin projects that only target the JVM. However, when using Kotlin multiplatform and also targeting the JVM, the native-image plugin does not seem to apply.
Kotlin can only target native platforms by itself if all (transitive) dependencies are also available for the target platform. As the Kotlin multiplatform (KMP) ecosystem is still growing, it's often the case that for a specific problem only a Java library exists.
Also to compare GraalVM native images to native binaries created by Kotlin directly, it would be great if the native-image plugin would also recognize the Kotlin multiplatform plugin in Gradle project, and "hook into" the JVM target to provide the nativeCompile etc. tasks.
The native-image plugin for Gradle works fine with Kotlin/JVM projects, i.e. Kotlin projects that only target the JVM. However, when using Kotlin multiplatform and also targeting the JVM, the native-image plugin does not seem to apply.
Kotlin can only target native platforms by itself if all (transitive) dependencies are also available for the target platform. As the Kotlin multiplatform (KMP) ecosystem is still growing, it's often the case that for a specific problem only a Java library exists.
Also to compare GraalVM native images to native binaries created by Kotlin directly, it would be great if the native-image plugin would also recognize the Kotlin multiplatform plugin in Gradle project, and "hook into" the JVM target to provide the
nativeCompileetc. tasks.