| 1 | import java.io.FileInputStream |
| 2 | import java.util.Properties |
| 3 | |
| 4 | plugins { |
| 5 | id("com.android.application") |
| 6 | id("org.jetbrains.kotlin.android") |
| 7 | id("rust") |
| 8 | } |
| 9 | |
| 10 | val tauriProperties = Properties().apply { |
| 11 | val propFile = file("tauri.properties") |
| 12 | if (propFile.exists()) { |
| 13 | propFile.inputStream().use { load(it) } |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | android { |
| 18 | compileSdk = 36 |
| 19 | namespace = "xyz.smbcloud.streetcut" |
| 20 | defaultConfig { |
| 21 | manifestPlaceholders["usesCleartextTraffic"] = "false" |
| 22 | applicationId = "xyz.smbcloud.streetcut" |
| 23 | minSdk = 24 |
| 24 | targetSdk = 36 |
| 25 | versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt() |
| 26 | versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0") |
| 27 | } |
| 28 | signingConfigs { |
| 29 | create("release") { |
| 30 | val keystorePropertiesFile = rootProject.file("keystore.properties") |
| 31 | val keystoreProperties = Properties() |
| 32 | if (keystorePropertiesFile.exists()) { |
| 33 | keystoreProperties.load(FileInputStream(keystorePropertiesFile)) |
| 34 | } |
| 35 | |
| 36 | keyAlias = keystoreProperties["keyAlias"] as String |
| 37 | keyPassword = keystoreProperties["password"] as String |
| 38 | storeFile = file(keystoreProperties["storeFile"] as String) |
| 39 | storePassword = keystoreProperties["password"] as String |
| 40 | } |
| 41 | } |
| 42 | buildTypes { |
| 43 | getByName("debug") { |
| 44 | manifestPlaceholders["usesCleartextTraffic"] = "true" |
| 45 | isDebuggable = true |
| 46 | isJniDebuggable = true |
| 47 | isMinifyEnabled = false |
| 48 | packaging { jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so") |
| 49 | jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so") |
| 50 | jniLibs.keepDebugSymbols.add("*/x86/*.so") |
| 51 | jniLibs.keepDebugSymbols.add("*/x86_64/*.so") |
| 52 | } |
| 53 | } |
| 54 | getByName("release") { |
| 55 | signingConfig = signingConfigs.getByName("release") |
| 56 | isMinifyEnabled = true |
| 57 | proguardFiles( |
| 58 | *fileTree(".") { include("**/*.pro") } |
| 59 | .plus(getDefaultProguardFile("proguard-android-optimize.txt")) |
| 60 | .toList().toTypedArray() |
| 61 | ) |
| 62 | } |
| 63 | } |
| 64 | kotlinOptions { |
| 65 | jvmTarget = "1.8" |
| 66 | } |
| 67 | buildFeatures { |
| 68 | buildConfig = true |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | rust { |
| 73 | rootDirRel = "../../../" |
| 74 | } |
| 75 | |
| 76 | dependencies { |
| 77 | implementation("androidx.webkit:webkit:1.14.0") |
| 78 | implementation("androidx.appcompat:appcompat:1.7.1") |
| 79 | implementation("androidx.activity:activity-ktx:1.10.1") |
| 80 | implementation("com.google.android.material:material:1.12.0") |
| 81 | testImplementation("junit:junit:4.13.2") |
| 82 | androidTestImplementation("androidx.test.ext:junit:1.1.4") |
| 83 | androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0") |
| 84 | } |
| 85 | |
| 86 | apply(from = "tauri.build.gradle.kts") |