Initial commit

This commit is contained in:
2026-04-23 22:50:48 +02:00
commit bf8b46bff2
63 changed files with 5137 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
package dev.ulfrx.recipe
import android.os.Build
class AndroidPlatform : Platform {
override val name: String = "Android ${Build.VERSION.SDK_INT}"
}
actual fun getPlatform(): Platform = AndroidPlatform()

View File

@@ -0,0 +1,3 @@
package dev.ulfrx.recipe
const val SERVER_PORT = 8080

View File

@@ -0,0 +1,9 @@
package dev.ulfrx.recipe
class Greeting {
private val platform = getPlatform()
fun greet(): String {
return "Hello, ${platform.name}!"
}
}

View File

@@ -0,0 +1,7 @@
package dev.ulfrx.recipe
interface Platform {
val name: String
}
expect fun getPlatform(): Platform

View File

@@ -0,0 +1,12 @@
package dev.ulfrx.recipe
import kotlin.test.Test
import kotlin.test.assertEquals
class SharedCommonTest {
@Test
fun example() {
assertEquals(3, 1 + 2)
}
}

View File

@@ -0,0 +1,9 @@
package dev.ulfrx.recipe
import platform.UIKit.UIDevice
class IOSPlatform : Platform {
override val name: String = UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion
}
actual fun getPlatform(): Platform = IOSPlatform()

View File

@@ -0,0 +1,7 @@
package dev.ulfrx.recipe
class JsPlatform : Platform {
override val name: String = "Web with Kotlin/JS"
}
actual fun getPlatform(): Platform = JsPlatform()

View File

@@ -0,0 +1,7 @@
package dev.ulfrx.recipe
class JVMPlatform : Platform {
override val name: String = "Java ${System.getProperty("java.version")}"
}
actual fun getPlatform(): Platform = JVMPlatform()

View File

@@ -0,0 +1,7 @@
package dev.ulfrx.recipe
class WasmPlatform : Platform {
override val name: String = "Web with Kotlin/Wasm"
}
actual fun getPlatform(): Platform = WasmPlatform()