Join Slack
Powered by
Has anyone used expect/actual to build different v...
# library-development
e
Emil Kantis
05/08/2024, 5:58 PM
Has anyone used expect/actual to build different variants of a library depending on the JVM version the consumer targets?
👀 3
c
CLOVIS
05/09/2024, 8:28 AM
Not that I'm aware of, but you should be able to follow this approach:
https://kotlinlang.org/docs/multiplatform-set-up-targets.html#distinguish-several-targets-for-one-platform
. The attribute you want is `org.gradle.jvm.version`:
https://docs.gradle.org/current/userguide/variant_attributes.html#sub:jvm_default_attributes
m
mbonnin
05/09/2024, 10:51 AM
I'm still a bit unclear whether multiple JVM targets is going to be supported longer term, see
https://youtrack.jetbrains.com/issue/KT-59316/Deprecate-multiple-same-targets
âž• 2
mbonnin
05/09/2024, 10:55 AM
See also
https://kotlinlang.org/docs/multiplatform-compatibility-guide.html#declaring-several-similar-targets
2
Views
Open in Slack
Previous
Next