🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
125 lines
3.5 KiB
Kotlin
125 lines
3.5 KiB
Kotlin
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
|
|
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
|
|
plugins {
|
|
alias(libs.plugins.kotlinMultiplatform)
|
|
alias(libs.plugins.androidApplication)
|
|
alias(libs.plugins.composeMultiplatform)
|
|
alias(libs.plugins.composeCompiler)
|
|
alias(libs.plugins.composeHotReload)
|
|
alias(libs.plugins.kotlinxSerialization)
|
|
}
|
|
|
|
kotlin {
|
|
androidTarget {
|
|
compilerOptions {
|
|
jvmTarget.set(JvmTarget.JVM_11)
|
|
}
|
|
}
|
|
|
|
listOf(
|
|
iosArm64(),
|
|
iosSimulatorArm64()
|
|
).forEach { iosTarget ->
|
|
iosTarget.binaries.framework {
|
|
baseName = "ComposeApp"
|
|
isStatic = true
|
|
}
|
|
}
|
|
|
|
jvm()
|
|
|
|
js {
|
|
browser()
|
|
binaries.executable()
|
|
}
|
|
|
|
@OptIn(ExperimentalWasmDsl::class)
|
|
wasmJs {
|
|
browser()
|
|
binaries.executable()
|
|
}
|
|
|
|
sourceSets {
|
|
androidMain.dependencies {
|
|
implementation(compose.preview)
|
|
implementation(libs.androidx.activity.compose)
|
|
implementation(libs.ktor.client.okhttp)
|
|
|
|
// implementation(libs.ktor.client.logging)
|
|
implementation(libs.kotlinx.coroutines.android)
|
|
}
|
|
iosMain.dependencies {
|
|
implementation(libs.ktor.client.darwin)
|
|
}
|
|
commonMain.dependencies {
|
|
implementation(libs.ktor.serialization.kotlinx.json)
|
|
implementation(libs.ktor.client.content.negotiation)
|
|
implementation(compose.runtime)
|
|
implementation(compose.foundation)
|
|
implementation(compose.material3)
|
|
implementation(compose.ui)
|
|
implementation(compose.components.resources)
|
|
implementation(compose.components.uiToolingPreview)
|
|
implementation(libs.androidx.lifecycle.viewmodelCompose)
|
|
implementation(libs.androidx.lifecycle.runtimeCompose)
|
|
implementation(libs.ktor.client.core)
|
|
implementation(libs.kotlinx.coroutines.core)
|
|
implementation(libs.ktor.client.logging)
|
|
implementation("org.jetbrains.androidx.navigation:navigation-compose:2.9.1")
|
|
implementation(compose.materialIconsExtended)
|
|
}
|
|
commonTest.dependencies {
|
|
implementation(libs.kotlin.test)
|
|
}
|
|
jvmMain.dependencies {
|
|
implementation(compose.desktop.currentOs)
|
|
implementation(libs.kotlinx.coroutinesSwing)
|
|
}
|
|
}
|
|
}
|
|
|
|
android {
|
|
namespace = "com.example.mycrib"
|
|
compileSdk = libs.versions.android.compileSdk.get().toInt()
|
|
|
|
defaultConfig {
|
|
applicationId = "com.example.mycrib"
|
|
minSdk = libs.versions.android.minSdk.get().toInt()
|
|
targetSdk = libs.versions.android.targetSdk.get().toInt()
|
|
versionCode = 1
|
|
versionName = "1.0"
|
|
}
|
|
packaging {
|
|
resources {
|
|
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
|
}
|
|
}
|
|
buildTypes {
|
|
getByName("release") {
|
|
isMinifyEnabled = false
|
|
}
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
debugImplementation(compose.uiTooling)
|
|
}
|
|
|
|
compose.desktop {
|
|
application {
|
|
mainClass = "com.example.mycrib.MainKt"
|
|
|
|
nativeDistributions {
|
|
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
|
|
packageName = "com.example.mycrib"
|
|
packageVersion = "1.0.0"
|
|
}
|
|
}
|
|
}
|