refactor: move logic to core module
This commit is contained in:
parent
f3fca134c7
commit
dae42c48f2
13 changed files with 75 additions and 24 deletions
|
|
@ -0,0 +1,9 @@
|
|||
package moe.lava.neon.core
|
||||
|
||||
import android.os.Build
|
||||
|
||||
class AndroidPlatform : Platform {
|
||||
override val name: String = "Android ${Build.VERSION.SDK_INT}"
|
||||
}
|
||||
|
||||
actual fun getPlatform(): Platform = AndroidPlatform()
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package moe.lava.neon.core
|
||||
|
||||
interface Platform {
|
||||
val name: String
|
||||
}
|
||||
|
||||
expect fun getPlatform(): Platform
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package moe.lava.neon.core
|
||||
|
||||
class JVMPlatform : Platform {
|
||||
override val name: String = "Java ${System.getProperty("java.version")}"
|
||||
}
|
||||
|
||||
actual fun getPlatform(): Platform = JVMPlatform()
|
||||
Loading…
Add table
Add a link
Reference in a new issue