v79
01/07/2022, 2:26 PMimport com.github.quillraven.fleks.World
is highlighted red too. So.... what do I do?Hadji Musaev
01/07/2022, 2:29 PMAnton Afanasev
01/07/2022, 2:48 PMsourceSets {
commonMain {
// Only Multiplatform dependencies here
}
jvmMain {
// Only jvm specific dependencies here
}
}
Hadji Musaev
01/07/2022, 2:50 PMimport
should also be put into jvmMain somewherev79
01/07/2022, 2:52 PMkotlin {
sourceSets {
val commonMain by getting {
kotlin.srcDir("$buildDir/generated/source/kaptKotlin/main")
dependencies {
implementation("com.lehaine.kiwi:kiwi:$kiwiVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationVersion")
implementation("com.soywiz.korlibs.klogger:klogger:$kloggerVersion")
}
}
val jvmMain by getting {
dependencies {
implementation("io.github.quillraven.fleks:Fleks:1.0-RC1") /// THIS IS THE JVM LIB I WANT
configurations.all { // kapt has an issue with determining the correct KMM library, so we need to help it
if (name.contains("kapt")) {
attributes.attribute(
org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.attribute,
org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.jvm // pass in the JVM
)
}
}
}
}
}
}
v79
01/07/2022, 2:53 PMHadji Musaev
01/07/2022, 2:53 PMval jvmMain by gettingis there 🙂 Maybe you mean you don’t have a corresponding module in you project structure? You can create it
Hadji Musaev
01/07/2022, 2:53 PMHadji Musaev
01/07/2022, 2:55 PMv79
01/07/2022, 2:56 PMAnton Afanasev
01/07/2022, 2:57 PMcommonMain {
}
Since it is a multiplatform library, then it should be imported from the commonMain
.
And then you might need to import a platform specific dependeny as well.Hadji Musaev
01/07/2022, 3:10 PMcommonMain
.
2. Add jvmMain
next to it.
3. Put your main class there and produce the runnable artifact from there as well.
In your case this structure could be minimised to only have commonMain
and jvmMain
(and testing modules optionally)Hadji Musaev
01/07/2022, 3:10 PM