mirror of
https://github.com/avinal/nikki.git
synced 2026-07-03 21:40:09 +05:30
Add module build configs and platform expect/actual stubs
- composeApp/build.gradle.kts: KMP targets (android + iOS), all dependencies - androidApp/build.gradle.kts: Android app with compose compiler - Platform.kt expect/actual for Android and iOS - Android resources: launcher icons, themes, manifest Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.kotlin.multiplatform)
|
||||
alias(libs.plugins.android.kmp.library)
|
||||
alias(libs.plugins.compose.multiplatform)
|
||||
alias(libs.plugins.compose.compiler)
|
||||
alias(libs.plugins.kotlin.serialization)
|
||||
alias(libs.plugins.ksp)
|
||||
alias(libs.plugins.room)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
@Suppress("DEPRECATION")
|
||||
androidLibrary {
|
||||
namespace = "com.avinal.memos.shared"
|
||||
compileSdk = 36
|
||||
minSdk = 26
|
||||
|
||||
compilerOptions {
|
||||
jvmTarget.set(JvmTarget.JVM_11)
|
||||
}
|
||||
}
|
||||
|
||||
listOf(
|
||||
iosArm64(),
|
||||
iosSimulatorArm64()
|
||||
).forEach { iosTarget ->
|
||||
iosTarget.binaries.framework {
|
||||
baseName = "ComposeApp"
|
||||
isStatic = true
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
commonMain.dependencies {
|
||||
implementation(compose.runtime)
|
||||
implementation(compose.foundation)
|
||||
implementation(compose.material3)
|
||||
implementation(compose.materialIconsExtended)
|
||||
implementation(compose.ui)
|
||||
implementation(compose.components.resources)
|
||||
|
||||
implementation(libs.androidx.lifecycle.viewmodel)
|
||||
implementation(libs.androidx.navigation.compose)
|
||||
implementation(libs.androidx.datastore.preferences)
|
||||
implementation(libs.kotlinx.coroutines.core)
|
||||
implementation(libs.kotlinx.serialization.json)
|
||||
implementation(libs.kotlinx.datetime)
|
||||
|
||||
implementation(libs.ktor.client.core)
|
||||
implementation(libs.ktor.client.content.negotiation)
|
||||
implementation(libs.ktor.serialization.kotlinx.json)
|
||||
|
||||
implementation(libs.coil.compose)
|
||||
implementation(libs.coil.network.ktor)
|
||||
|
||||
implementation(libs.room.runtime)
|
||||
implementation(libs.sqlite.bundled)
|
||||
}
|
||||
|
||||
androidMain.dependencies {
|
||||
implementation(libs.kotlinx.coroutines.android)
|
||||
implementation(libs.ktor.client.okhttp)
|
||||
implementation(libs.androidx.work.runtime)
|
||||
}
|
||||
|
||||
iosMain.dependencies {
|
||||
implementation(libs.ktor.client.darwin)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
room {
|
||||
schemaDirectory("$projectDir/schemas")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
add("kspAndroid", libs.room.compiler)
|
||||
add("kspIosSimulatorArm64", libs.room.compiler)
|
||||
add("kspIosArm64", libs.room.compiler)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package com.avinal.memos
|
||||
|
||||
actual fun getPlatformName(): String = "Android"
|
||||
@@ -0,0 +1,3 @@
|
||||
package com.avinal.memos
|
||||
|
||||
expect fun getPlatformName(): String
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.avinal.memos
|
||||
|
||||
import androidx.compose.ui.window.ComposeUIViewController
|
||||
|
||||
fun MainViewController() = ComposeUIViewController { App() }
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.avinal.memos
|
||||
|
||||
import platform.UIKit.UIDevice
|
||||
|
||||
actual fun getPlatformName(): String =
|
||||
UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion
|
||||
Reference in New Issue
Block a user