Hi! Is there a way to define an optional dependency for Kotlin/Native, akin to how
compileOnly
works for other targets?
a
Adam Semenenko
10/21/2024, 3:23 PM
In short: no.
related: KT-64109
tl;dr: it's a limitation of the Kotlin/Native compilation process, which requires dependencies are always present during compilation and runtime.
b
Bernd Prünster
10/21/2024, 4:05 PM
Thanks! That is what I was afraid of. This is really a pity. Espacially given how powerful the combination of extension functions and compile-only dependencies works on the jvm: add dependency 'A' to a project that has 'B' as compile-only dependency and defines some extensions on types of 'B'. You'll never notice. Once you add 'B' too, you magically get the extensions with IDE autocomplete. Are there any plans to remedy this shortcoming?
a
Adam Semenenko
10/25/2024, 7:40 AM
I'm not aware of any plans, unfortunately, but I don't work very closely with Kotlin Native. You could try asking in #C3SGXARS6.