|
| 1 | +@Suppress("DSL_SCOPE_VIOLATION") |
| 2 | +plugins { |
| 3 | + alias(libs.plugins.android.app) |
| 4 | + alias(libs.plugins.kotlin.android) |
| 5 | + alias(libs.plugins.jetbrains.compose) |
| 6 | + alias(libs.plugins.kotlin.compose) |
| 7 | +} |
| 8 | + |
| 9 | +android { |
| 10 | + namespace = "com.hoc081098.channeleventbus.sample.kmp.compose.android" |
| 11 | + compileSdk = libs.versions.sample.android.compile.get().toInt() |
| 12 | + defaultConfig { |
| 13 | + applicationId = "com.hoc081098.channeleventbus.sample.kmp.compose.android" |
| 14 | + minSdk = libs.versions.android.min.get().toInt() |
| 15 | + targetSdk = libs.versions.sample.android.target.get().toInt() |
| 16 | + versionCode = 1 |
| 17 | + versionName = "1.0" |
| 18 | + } |
| 19 | + buildFeatures { |
| 20 | + buildConfig = true |
| 21 | + } |
| 22 | + packaging { |
| 23 | + resources { |
| 24 | + excludes += "/META-INF/{AL2.0,LGPL2.1}" |
| 25 | + } |
| 26 | + } |
| 27 | + buildTypes { |
| 28 | + getByName("release") { |
| 29 | + isMinifyEnabled = false |
| 30 | + } |
| 31 | + } |
| 32 | + compileOptions { |
| 33 | + sourceCompatibility = JavaVersion.toVersion(libs.versions.java.target.get()) |
| 34 | + targetCompatibility = JavaVersion.toVersion(libs.versions.java.target.get()) |
| 35 | + } |
| 36 | + kotlinOptions { |
| 37 | + jvmTarget = JavaVersion.toVersion(libs.versions.java.target.get()).toString() |
| 38 | + } |
| 39 | +} |
| 40 | + |
| 41 | +kotlin { |
| 42 | + jvmToolchain { |
| 43 | + languageVersion = JavaLanguageVersion.of(libs.versions.java.toolchain.get()) |
| 44 | + vendor = JvmVendorSpec.AZUL |
| 45 | + } |
| 46 | +} |
| 47 | + |
| 48 | +dependencies { |
| 49 | + // Compose app |
| 50 | + implementation(projects.sample.standaloneComposeMultiplatform.composeApp) |
| 51 | + |
| 52 | + implementation(libs.androidx.activity.compose) |
| 53 | + implementation(libs.koin.androidx.compose) |
| 54 | + |
| 55 | + implementation(libs.flowExt) |
| 56 | + |
| 57 | + implementation(libs.timber) |
| 58 | +} |
| 59 | + |
| 60 | +composeCompiler { |
| 61 | + featureFlags.addAll( |
| 62 | + org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag.OptimizeNonSkippingGroups, |
| 63 | + ) |
| 64 | + |
| 65 | + val composeCompilerDir = layout.buildDirectory.dir("compose_compiler") |
| 66 | + if (project.findProperty("composeCompilerReports") == "true") { |
| 67 | + reportsDestination = composeCompilerDir |
| 68 | + } |
| 69 | + if (project.findProperty("composeCompilerMetrics") == "true") { |
| 70 | + metricsDestination = composeCompilerDir |
| 71 | + } |
| 72 | +} |
0 commit comments