okarm
12/02/2024, 9:27 AMshared
and K/JVM
should, but can't.
The JVM project is incapable of consuming shared
directly as implementation(project(":shared"))
due to a limitation of the project framework's Gradle plugin which cannot handle KMP source set layout (Quarkus framework).
Therefore, I added the commonMain/kotlin
directory of shared
directly as an additional source directory to the JVM project:
sourceSets {
val main by getting {
kotlin.srcDir("../shared/src/commonMain/kotlin")
}
}
However, this action makes the JVM project "take full ownership" of the directory, assigning it to its main
source set, and this makes the symbols unresolvable in the IDE when they are referenced in the K/JS project. This is only an IDE issue
. All code compiles without errors. It is IntelliJ IDEA which reassigns the directory to the JVM project and then fails to resolve the symbols when they are referenced other sibling projects.
Does anyone have experience with similar setups, is it fixable? I have an ugly workaround using a combination of another JVM project and a symbolic link, but I'm trying to move away from that hack.okarm
12/02/2024, 9:31 AMcommonMain/kotlin
directory as seen after the JVM project takes ownership of it.okarm
12/02/2024, 9:33 AMsourceSets {
val commonMain by creating {
kotlin.srcDir("../shared/src/commonMain/kotlin")
}
val main by getting {
dependsOn(commonMain)
}
}