build.gradle.kts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import java.util.Properties
  2. plugins {
  3. id("com.android.application")
  4. id("org.jetbrains.kotlin.android")
  5. id("rust")
  6. }
  7. val tauriProperties = Properties().apply {
  8. val propFile = file("tauri.properties")
  9. if (propFile.exists()) {
  10. propFile.inputStream().use { load(it) }
  11. }
  12. }
  13. android {
  14. compileSdk = 34
  15. namespace = "com.qihuan.store_app"
  16. defaultConfig {
  17. manifestPlaceholders["usesCleartextTraffic"] = "false"
  18. applicationId = "com.qihuan.store_app"
  19. minSdk = 24
  20. targetSdk = 34
  21. versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt()
  22. versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0")
  23. }
  24. buildTypes {
  25. getByName("debug") {
  26. manifestPlaceholders["usesCleartextTraffic"] = "true"
  27. isDebuggable = true
  28. isJniDebuggable = true
  29. isMinifyEnabled = false
  30. packaging { jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so")
  31. jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so")
  32. jniLibs.keepDebugSymbols.add("*/x86/*.so")
  33. jniLibs.keepDebugSymbols.add("*/x86_64/*.so")
  34. }
  35. }
  36. getByName("release") {
  37. isMinifyEnabled = true
  38. proguardFiles(
  39. *fileTree(".") { include("**/*.pro") }
  40. .plus(getDefaultProguardFile("proguard-android-optimize.txt"))
  41. .toList().toTypedArray()
  42. )
  43. }
  44. }
  45. kotlinOptions {
  46. jvmTarget = "1.8"
  47. }
  48. buildFeatures {
  49. buildConfig = true
  50. }
  51. }
  52. rust {
  53. rootDirRel = "../../../"
  54. }
  55. dependencies {
  56. implementation("androidx.webkit:webkit:1.6.1")
  57. implementation("androidx.appcompat:appcompat:1.6.1")
  58. implementation("com.google.android.material:material:1.8.0")
  59. testImplementation("junit:junit:4.13.2")
  60. androidTestImplementation("androidx.test.ext:junit:1.1.4")
  61. androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
  62. }
  63. apply(from = "tauri.build.gradle.kts")