I'm working on an HTML & XML parsing library c...
# multiplatform
s
I'm working on an HTML & XML parsing library called Ksoup, which depends on the IO library Korlibs. I'm also developing another variant of the library that relies on kotlinx-io. Since Kotlin Multiplatform (KMP) doesn't natively support variants, I'm attempting to create two variants of the library by organizing the code into separate modules. Here's the approach I'm using: 1. ksoup-core-placeholder: Contains simple code that acts as a placeholder for the IO-related logic. 2. ksoup-core: Includes
ksoup-core-placeholder
as a
compileOnly
dependency. 3. ksoup-korio: Includes
ksoup-core
and the actual implementation for the IO logic, which is in
korio-io
. This setup works fine on JVM. However, for JS and iOS, I'm encountering the following error:
KLIB resolver: Could not find "ksoup:ksoup-core-placeholder"
If I remove the
compileOnly
, the library works fine on JVM and Native but not on JS, where it always uses the placeholder code instead of the actual implementation from
korio-io
. Code is in develop branch.