|
| 1 | +import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl |
| 2 | +import org.jetbrains.kotlin.gradle.dsl.JvmTarget |
| 3 | + |
| 4 | +plugins { |
| 5 | + alias(libs.plugins.androidLibrary) |
| 6 | + alias(libs.plugins.composeMultiplatform) |
| 7 | + alias(libs.plugins.kotlinMultiplatform) |
| 8 | + alias(libs.plugins.composeCompiler) |
| 9 | + alias(libs.plugins.composeHotReload) |
| 10 | +} |
| 11 | + |
| 12 | + |
| 13 | +kotlin { |
| 14 | + androidTarget { |
| 15 | + compilerOptions { |
| 16 | + jvmTarget.set(JvmTarget.JVM_11) |
| 17 | + } |
| 18 | + } |
| 19 | + |
| 20 | + listOf( |
| 21 | + iosArm64(), |
| 22 | + iosSimulatorArm64() |
| 23 | + ).forEach { iosTarget -> |
| 24 | + iosTarget.binaries.framework { |
| 25 | + baseName = "ComposeApp" |
| 26 | + isStatic = true |
| 27 | + } |
| 28 | + } |
| 29 | + |
| 30 | + jvm() |
| 31 | + |
| 32 | + js { |
| 33 | + browser() |
| 34 | + binaries.executable() |
| 35 | + } |
| 36 | + |
| 37 | + @OptIn(ExperimentalWasmDsl::class) |
| 38 | + wasmJs { |
| 39 | + browser() |
| 40 | + binaries.executable() |
| 41 | + } |
| 42 | + |
| 43 | + sourceSets { |
| 44 | + androidMain.dependencies { |
| 45 | + implementation(compose.preview) |
| 46 | + implementation(libs.androidx.activity.compose) |
| 47 | + } |
| 48 | + commonMain.dependencies { |
| 49 | + implementation(libs.androidx.core.ktx) |
| 50 | + implementation(libs.material) |
| 51 | + |
| 52 | + implementation(compose.runtime) |
| 53 | + implementation(compose.foundation) |
| 54 | + implementation(compose.material3) |
| 55 | + implementation(compose.ui) |
| 56 | + implementation(compose.components.resources) |
| 57 | + implementation(compose.components.uiToolingPreview) |
| 58 | + implementation(libs.androidx.lifecycle.viewmodelCompose) |
| 59 | + implementation(libs.androidx.lifecycle.runtimeCompose) |
| 60 | + } |
| 61 | + } |
| 62 | +} |
| 63 | + |
| 64 | + |
| 65 | +android { |
| 66 | + namespace = "dev.pranav.appintro" |
| 67 | + compileSdk { |
| 68 | + version = release(36) { |
| 69 | + minorApiLevel = 1 |
| 70 | + } |
| 71 | + } |
| 72 | + |
| 73 | + defaultConfig { |
| 74 | + minSdk = 26 |
| 75 | + |
| 76 | + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" |
| 77 | + consumerProguardFiles("consumer-rules.pro") |
| 78 | + } |
| 79 | + |
| 80 | + buildTypes { |
| 81 | + release { |
| 82 | + isMinifyEnabled = false |
| 83 | + proguardFiles( |
| 84 | + getDefaultProguardFile("proguard-android-optimize.txt"), |
| 85 | + "proguard-rules.pro" |
| 86 | + ) |
| 87 | + } |
| 88 | + } |
| 89 | + compileOptions { |
| 90 | + sourceCompatibility = JavaVersion.VERSION_11 |
| 91 | + targetCompatibility = JavaVersion.VERSION_11 |
| 92 | + } |
| 93 | + |
| 94 | + buildFeatures { |
| 95 | + compose = true |
| 96 | + } |
| 97 | +} |
0 commit comments