I'm working on an HTML & XML parsing library c...
# amper
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.
youtrack new 1
👀 1
@amakeev please check this
i
@Sabeeh I reproduced the problem with
../ksoup-core-placeholder: compile-only
. But I have the same error without
compile-only
. What do I need to change in your code?
s
@Ivan Kubyshkin i think you are trying that in single project there is issue with amper or gradle cache when i change deps it don't affect until i will remove .idea, .kotlin and .gradle folder and then try it again. This is also another big issue. You can test like following
Copy code
git clone <https://github.com/fleeksoft/ksoup.git> ksoup
cd ksoup
git checkout develop
./gradlew jsTest
this will fail with error: e: KLIB resolver: Could not find "ksoup1:ksoup-core-placeholder" but again
Copy code
git clone <https://github.com/fleeksoft/ksoup.git> ksoup2
cd ksoup2
git checkout develop

// edit ksoup-core/module.yaml and remove compile-only

./gradlew jsTest
this time build work fine but only tests will fail
@Ivan Kubyshkin this issue is related to KMP and reproduced with gradle project. I opened issue here https://youtrack.jetbrains.com/issue/KT-70727
🙏 2