Hi friends! Can KMP modules in the same project ta...
# multiplatform
p
Hi friends! Can KMP modules in the same project target different Java versions? We're maintaining a KMP library with: •
foo
(main module): provides features A and B, targets Java 11 •
bar
(optional): provides feature C, JVM-only, targets Java 11 •
baz
(optional): provides feature C, targets JVM, Native, JS, but requires Java 17 We'd prefer not to bump the entire project to Java 17 just for
baz
. So: 1. Is it safe/supported to have different modules target different Java versions (11 for `foo`/`bar`, 17 for
baz
) in the same project? 2. We use
tapmoc
for our builds, can we configure different Java target versions per module? Any gotchas or best practices we should be aware of? Thanks! 😊
e
you won't be able to use inline functions from a module with a higher target JVM in a module with a lower target
👀 1
otherwise mixing classes with different targets supported by the Java ecosystem - JVM was designed with this in mind
2
p
Awesome! Thanks, @ephemient! gratitude thank you