|
| 1 | +import org.jetbrains.compose.desktop.application.dsl.TargetFormat |
| 2 | +import org.jetbrains.kotlin.gradle.dsl.JvmTarget |
| 3 | + |
| 4 | +plugins { |
| 5 | + alias(libs.plugins.kotlinMultiplatform) |
| 6 | + alias(libs.plugins.androidApplication) |
| 7 | + alias(libs.plugins.composeMultiplatform) |
| 8 | + alias(libs.plugins.composeCompiler) |
| 9 | +} |
| 10 | + |
| 11 | +kotlin { |
| 12 | + androidTarget { |
| 13 | + compilerOptions { |
| 14 | + jvmTarget.set(JvmTarget.JVM_11) |
| 15 | + } |
| 16 | + } |
| 17 | + |
| 18 | + listOf( |
| 19 | + iosArm64(), |
| 20 | + iosSimulatorArm64() |
| 21 | + ).forEach { iosTarget -> |
| 22 | + iosTarget.binaries.framework { |
| 23 | + baseName = "ComposeApp" |
| 24 | + isStatic = true |
| 25 | + } |
| 26 | + } |
| 27 | + |
| 28 | + jvm() |
| 29 | + |
| 30 | + sourceSets { |
| 31 | + androidMain.dependencies { |
| 32 | + implementation(compose.preview) |
| 33 | + implementation(libs.androidx.activity.compose) |
| 34 | + } |
| 35 | + commonMain.dependencies { |
| 36 | + implementation(compose.runtime) |
| 37 | + implementation(compose.foundation) |
| 38 | + implementation(compose.material3) |
| 39 | + implementation(compose.ui) |
| 40 | + implementation(compose.components.resources) |
| 41 | + implementation(compose.components.uiToolingPreview) |
| 42 | + implementation(libs.androidx.lifecycle.viewmodelCompose) |
| 43 | + |
| 44 | + implementation(project(":websockets")) |
| 45 | + } |
| 46 | + jvmMain.dependencies { |
| 47 | + implementation(compose.desktop.currentOs) |
| 48 | + implementation(libs.kotlinx.coroutinesSwing) |
| 49 | + } |
| 50 | + } |
| 51 | +} |
| 52 | + |
| 53 | +android { |
| 54 | + namespace = "com.wannaverse.websocket" |
| 55 | + compileSdk = libs.versions.android.compileSdk.get().toInt() |
| 56 | + |
| 57 | + defaultConfig { |
| 58 | + applicationId = "com.wannaverse.websocket" |
| 59 | + minSdk = libs.versions.android.minSdk.get().toInt() |
| 60 | + targetSdk = libs.versions.android.targetSdk.get().toInt() |
| 61 | + versionCode = 1 |
| 62 | + versionName = "1.0" |
| 63 | + } |
| 64 | + packaging { |
| 65 | + resources { |
| 66 | + excludes += "/META-INF/{AL2.0,LGPL2.1}" |
| 67 | + } |
| 68 | + } |
| 69 | + buildTypes { |
| 70 | + getByName("release") { |
| 71 | + isMinifyEnabled = false |
| 72 | + } |
| 73 | + } |
| 74 | + compileOptions { |
| 75 | + sourceCompatibility = JavaVersion.VERSION_11 |
| 76 | + targetCompatibility = JavaVersion.VERSION_11 |
| 77 | + } |
| 78 | +} |
| 79 | + |
| 80 | +dependencies { |
| 81 | + debugImplementation(compose.uiTooling) |
| 82 | +} |
| 83 | + |
| 84 | +compose.desktop { |
| 85 | + application { |
| 86 | + mainClass = "com.wannaverse.websocket.MainKt" |
| 87 | + |
| 88 | + nativeDistributions { |
| 89 | + targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) |
| 90 | + packageName = "com.wannaverse.websocket" |
| 91 | + packageVersion = "1.0.0" |
| 92 | + } |
| 93 | + } |
| 94 | +} |
0 commit comments