星火管控
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.gradle.kts 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. @file:Suppress("CAST_NEVER_SUCCEEDS")
  2. import java.text.SimpleDateFormat
  3. import java.util.Date
  4. @Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
  5. plugins {
  6. alias(libs.plugins.androidApplication)
  7. alias(libs.plugins.kotlinAndroid)
  8. }
  9. android {
  10. namespace = "com.xhkjedu.manageapp"
  11. compileSdk = 34
  12. defaultConfig {
  13. applicationId = "com.xhkjedu.manageapp"
  14. minSdk = 24
  15. targetSdk = 30
  16. versionCode = 1
  17. versionName = "1.0"
  18. testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
  19. vectorDrawables {
  20. useSupportLibrary = true
  21. }
  22. ndk{
  23. abiFilters += listOf("armeabi","armeabi-v7a","arm64-v8a","x86","x86_64")
  24. }
  25. }
  26. viewBinding{
  27. enable=true
  28. }
  29. signingConfigs {
  30. create("keystore") {
  31. keyAlias = "xinghuo"
  32. keyPassword = "xhkjedu"
  33. storeFile = file("xinghuo.keystore")
  34. storePassword = "xhkjedu"
  35. }
  36. }
  37. buildTypes {
  38. /* release {
  39. isMinifyEnabled = false
  40. proguardFiles(
  41. getDefaultProguardFile("proguard-android-optimize.txt"),
  42. "proguard-rules.pro"
  43. )
  44. }*/
  45. val signConfig=signingConfigs.getByName("keystore")
  46. getByName("release") {
  47. isMinifyEnabled = false
  48. proguardFiles(
  49. getDefaultProguardFile("proguard-android-optimize.txt"),
  50. "proguard-rules.pro"
  51. )
  52. signingConfig=signConfig
  53. }
  54. getByName("debug") {
  55. isMinifyEnabled = false
  56. proguardFiles(
  57. getDefaultProguardFile("proguard-android-optimize.txt"),
  58. "proguard-rules.pro"
  59. )
  60. signingConfig=signConfig
  61. }
  62. }
  63. compileOptions {
  64. sourceCompatibility = JavaVersion.VERSION_1_8
  65. targetCompatibility = JavaVersion.VERSION_1_8
  66. }
  67. kotlinOptions {
  68. jvmTarget = "1.8"
  69. }
  70. buildFeatures {
  71. compose = true
  72. }
  73. composeOptions {
  74. kotlinCompilerExtensionVersion = "1.4.3"
  75. }
  76. packaging {
  77. resources {
  78. excludes += "/META-INF/{AL2.0,LGPL2.1}"
  79. }
  80. }
  81. lint {
  82. abortOnError=false
  83. }
  84. fun releaseTime(): String {
  85. val dateFormat = SimpleDateFormat("yyyyMMdd")
  86. return dateFormat.format(Date())
  87. }
  88. android.applicationVariants.all {variant->
  89. variant.outputs.all {output->
  90. val versionName = variant.versionName
  91. val versionCode = variant.versionCode
  92. val variantName = variant.name
  93. val apkName = "Manage_App-$variantName-$versionName-$versionCode-${releaseTime()}.apk"
  94. output.outputFile.renameTo(File(output.outputFile.parentFile,apkName))
  95. }
  96. }
  97. }
  98. dependencies {
  99. implementation(libs.core.ktx)
  100. implementation(libs.lifecycle.runtime.ktx)
  101. implementation(libs.activity.compose)
  102. implementation(platform(libs.compose.bom))
  103. implementation(libs.ui)
  104. implementation(libs.ui.graphics)
  105. implementation(libs.ui.tooling.preview)
  106. implementation(libs.material3)
  107. implementation(libs.appcompat)
  108. implementation(libs.androidx.recyclerview)
  109. implementation(project(mapOf("path" to ":websocket")))
  110. implementation(libs.androidx.cardview)
  111. testImplementation(libs.junit)
  112. implementation("com.baidu.lbsyun:BaiduMapSDK_Location_All:9.3.7")
  113. androidTestImplementation(libs.androidx.test.ext.junit)
  114. androidTestImplementation(libs.espresso.core)
  115. androidTestImplementation(platform(libs.compose.bom))
  116. androidTestImplementation(libs.ui.test.junit4)
  117. debugImplementation(libs.ui.tooling)
  118. debugImplementation(libs.ui.test.manifest)
  119. }