:wave: I have a kmp lib that is a tool for develop...
# library-development
c
👋 I have a kmp lib that is a tool for developers. Because of that, there should be 2 variants of the library. One for debug (the library code is fully integrated into developer artifact - apk, jar, ...) and one for release (the library code that is integrated into developer artifact has only the public code with empty bodies). How would you design this in order to avoid to switch between 2 variants each time when the developer needs a new artifact? Unfortunatly, in kmp we do not have debugImplementation and releaseImplementation.
c
In theory, you could implement this with Gradle's variants, but I don't advise it. I've been playing with them myself and they're very unstable when it comes to KMP. What is the difference between both artifacts? You mention the release artifacts don't contain the implementation code, but that doesn't make sense to me, that code is required at runtime for the library to do anything? If the difference is the presence of debug statements, you can have a global boolean to enable/disable debug mode, and hope that the runtime will inline it everywhere (at least, the JVM should).
c
Similar to https://github.com/ChuckerTeam/chucker?tab=readme-ov-file#getting-started . They have 2 artifacts: one for release one for debug. For release the tool is not needed .