| 1 | plugins { |
| 2 | id("com.android.application") version "8.13.2" |
| 3 | id("org.jetbrains.kotlin.android") version "2.3.20" |
| 4 | id("org.jetbrains.kotlin.plugin.compose") version "2.3.20" |
| 5 | } |
| 6 | |
| 7 | val petAssets by tasks.registering(Sync::class) { |
| 8 | from("../ios/Resources") { include("pet-native.js", "demo.jsonl") } |
| 9 | from("../whale-points.tsv") |
| 10 | from("../LICENSE") |
| 11 | from("../NOTICE") |
| 12 | from("THIRD_PARTY_NOTICES.txt") |
| 13 | into(layout.buildDirectory.dir("generated/petAssets")) |
| 14 | } |
| 15 | val portableSources by tasks.registering(Sync::class) { |
| 16 | from(files("PetSim.kt", "CodewhalePet.kt")) |
| 17 | into(layout.buildDirectory.dir("generated/portableKotlin")) |
| 18 | } |
| 19 | |
| 20 | android { |
| 21 | namespace = "codewhale.pet" |
| 22 | compileSdk = 35 |
| 23 | defaultConfig { |
| 24 | applicationId = "dev.shannonlabs.codewhale.pet" |
| 25 | minSdk = 26 |
| 26 | targetSdk = 35 |
| 27 | versionCode = 1 |
| 28 | versionName = "0.1.0" |
| 29 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" |
| 30 | } |
| 31 | sourceSets["main"].apply { |
| 32 | java.setSrcDirs(listOf("src/main/kotlin")) |
| 33 | java.srcDir(layout.buildDirectory.dir("generated/portableKotlin")) |
| 34 | assets.srcDir(layout.buildDirectory.dir("generated/petAssets")) |
| 35 | } |
| 36 | buildFeatures { compose = true } |
| 37 | compileOptions { |
| 38 | sourceCompatibility = JavaVersion.VERSION_17 |
| 39 | targetCompatibility = JavaVersion.VERSION_17 |
| 40 | } |
| 41 | packaging { resources.excludes += "/META-INF/{AL2.0,LGPL2.1}" } |
| 42 | lint { abortOnError = true } |
| 43 | } |
| 44 | tasks.named("preBuild") { dependsOn(petAssets, portableSources) } |
| 45 | kotlin { jvmToolchain(17) } |
| 46 | |
| 47 | dependencies { |
| 48 | implementation(platform("androidx.compose:compose-bom:2025.04.01")) |
| 49 | implementation("androidx.compose.ui:ui") |
| 50 | implementation("androidx.compose.foundation:foundation") |
| 51 | implementation("androidx.compose.material3:material3") |
| 52 | implementation("androidx.activity:activity-compose:1.10.1") |
| 53 | implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.9.0") |
| 54 | implementation("androidx.lifecycle:lifecycle-runtime-compose:2.9.0") |
| 55 | implementation("app.cash.zipline:zipline:1.27.0") |
| 56 | androidTestImplementation("androidx.test.ext:junit:1.2.1") |
| 57 | androidTestImplementation("androidx.test:runner:1.6.2") |
| 58 | androidTestImplementation(platform("androidx.compose:compose-bom:2025.04.01")) |
| 59 | androidTestImplementation("androidx.compose.ui:ui-test-junit4") |
| 60 | debugImplementation("androidx.compose.ui:ui-test-manifest") |
| 61 | } |
| 62 |