Koneko Toujou
02/06/2023, 3:17 PMexpect
and actual
translate to in java
eg
expect fun getPlatformName(): String
actual fun getPlatformName(): String {
return "Desktop"
}
hfhbd
02/06/2023, 3:22 PMKoneko Toujou
02/06/2023, 3:23 PMKoneko Toujou
02/06/2023, 3:24 PMLandry Norris
02/06/2023, 3:24 PMKoneko Toujou
02/06/2023, 3:24 PMhfhbd
02/06/2023, 3:25 PMKoneko Toujou
02/06/2023, 3:26 PMLandry Norris
02/06/2023, 3:27 PMGoetz Markgraf
02/06/2023, 3:27 PMinterface
and class
but it is not a translation but only another implementation of a similar concept.Koneko Toujou
02/06/2023, 3:28 PMLandry Norris
02/06/2023, 3:28 PMKoneko Toujou
02/06/2023, 3:30 PMLandry Norris
02/06/2023, 3:31 PMkotlin {
jvm {
withJava()
}
}
Note you can’t have this and an android target in the same module.Koneko Toujou
02/06/2023, 3:42 PMplugins {
kotlin("multiplatform")
id("org.jetbrains.compose")
id("com.android.library")
}
kotlin {
android()
jvm("desktop") {
jvmToolchain(11)
}
sourceSets {
val commonMain by getting { dependencies { ... } }
val androidMain by getting { dependencies { ... } }
val desktopMain by getting { dependencies { ... } }
}
}
android {
namespace = "smallville7123.lua.jit.kotlin.common"
compileSdkVersion(33)
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdkVersion(24)
targetSdkVersion(33)
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
Landry Norris
02/06/2023, 3:43 PMKoneko Toujou
02/06/2023, 3:45 PMKoneko Toujou
02/06/2023, 3:45 PMLandry Norris
02/06/2023, 3:45 PMKoneko Toujou
02/06/2023, 3:50 PMkotlin-impl-bindings-desktop
java-impl-desktop
kotlin-impl-bindings-android
java-impl-android
however the :common
module would require both desktop
and android
modules but i think it wont actually build both if only building for a single platform?Landry Norris
02/06/2023, 3:54 PMKoneko Toujou
02/06/2023, 3:54 PM