thalescm
09/23/2020, 3:29 PMapp
), not multiplatform, is not recognizing the code from the multiplatform module (named shared
).
Gradle sync is fine, so I imagine the problem is not on there.
app/build.gradle.kts:
plugins {
kotlin("jvm")
application
id("org.openjfx.javafxplugin") version("0.0.8")
kotlin("plugin.serialization")
}
dependencies {
<other jvm deps>
implementation(project(":shared"))
}
group = "group"
version = "1.0-SNAPSHOT"
application {
mainClass.set("pac.kage.MainKt")
}
javafx {
version = "12"
modules = listOf("javafx.controls", "javafx.fxml", "javafx.graphics")
}
tasks.withType<JavaExec>().configureEach {
doFirst {
println("Desktop classpath: ${classpath.asPath}")
jvmArgs = listOf(
"--module-path", classpath.asPath,
"--add-modules", "javafx.controls",
"--add-modules", "javafx.fxml",
"--add-modules", "javafx.graphics"
)
}
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}
And the shared/build.gradle.kts:
plugins {
kotlin("multiplatform")
id("kotlinx-serialization")
}
kotlin {
jvm {
val main by compilations.getting {
output
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib-common"))
}
}
val jvmMain by getting {
dependencies {
implementation(ExternalDeps.jipes)
implementation(kotlin("stdlib"))
}
}
}
}
sergiocarabantes
10/10/2020, 10:15 AMthalescm
10/10/2020, 9:45 PMandroidMain
instead of jvmMain