星火管控
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 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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 = 26
  17. versionName = "1.0.25"
  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. buildFeatures {
  38. compose = true
  39. buildConfig=true
  40. }
  41. buildTypes {
  42. /* release {
  43. isMinifyEnabled = false
  44. proguardFiles(
  45. getDefaultProguardFile("proguard-android-optimize.txt"),
  46. "proguard-rules.pro"
  47. )
  48. }*/
  49. val signConfig=signingConfigs.getByName("keystore")
  50. getByName("release") {
  51. isMinifyEnabled = false
  52. proguardFiles(
  53. getDefaultProguardFile("proguard-android-optimize.txt"),
  54. "proguard-rules.pro"
  55. )
  56. signingConfig=signConfig
  57. buildConfigField("boolean", "IS_DEBUG", "false")
  58. }
  59. getByName("debug") {
  60. isMinifyEnabled = false
  61. proguardFiles(
  62. getDefaultProguardFile("proguard-android-optimize.txt"),
  63. "proguard-rules.pro"
  64. )
  65. signingConfig=signConfig
  66. buildConfigField("boolean", "IS_DEBUG", "true")
  67. }
  68. }
  69. compileOptions {
  70. sourceCompatibility = JavaVersion.VERSION_1_8
  71. targetCompatibility = JavaVersion.VERSION_1_8
  72. }
  73. kotlinOptions {
  74. jvmTarget = "1.8"
  75. }
  76. composeOptions {
  77. kotlinCompilerExtensionVersion = "1.4.3"
  78. }
  79. packaging {
  80. resources {
  81. excludes += "/META-INF/{AL2.0,LGPL2.1}"
  82. }
  83. }
  84. lint {
  85. abortOnError=false
  86. }
  87. fun releaseTime(): String {
  88. val dateFormat = SimpleDateFormat("yyyyMMdd")
  89. return dateFormat.format(Date())
  90. }
  91. applicationVariants.all{
  92. val versionName = this.versionName
  93. val versionCode = this.versionCode
  94. val variantName = this.name
  95. outputs.all {
  96. if (this is com.android.build.gradle.internal.api.ApkVariantOutputImpl){
  97. val fileName = "Manage_App-$variantName-$versionName-$versionCode-${releaseTime()}.apk"
  98. this.outputFileName=fileName
  99. }
  100. }
  101. }
  102. /* applicationVariants.all(
  103. object : Action<com.android.build.gradle.api.ApplicationVariant> {
  104. override fun execute(variant: com.android.build.gradle.api.ApplicationVariant) {
  105. println("variant: $variant")
  106. variant.outputs.all(
  107. object : Action<com.android.build.gradle.api.BaseVariantOutput> {
  108. override fun execute(
  109. output: com.android.build.gradle.api.BaseVariantOutput
  110. ) {
  111. val versionName = variant.versionName
  112. val versionCode = variant.versionCode
  113. val variantName = variant.name
  114. val outputImpl = output as com.android.build.gradle.internal.api.BaseVariantOutputImpl
  115. val fileName = "Manage_App-$variantName-$versionName-$versionCode-${releaseTime()}.apk"
  116. println("output file name: $fileName")
  117. outputImpl.outputFileName = fileName
  118. }
  119. }
  120. )
  121. }
  122. }
  123. )*/
  124. }
  125. dependencies {
  126. implementation(libs.core.ktx)
  127. implementation(libs.lifecycle.runtime.ktx)
  128. implementation(libs.activity.compose)
  129. implementation(platform(libs.compose.bom))
  130. implementation(libs.ui)
  131. implementation(libs.ui.graphics)
  132. implementation(libs.ui.tooling.preview)
  133. implementation(libs.material3)
  134. implementation(libs.appcompat)
  135. implementation(libs.androidx.recyclerview)
  136. implementation(project(mapOf("path" to ":websocket")))
  137. implementation(libs.androidx.cardview)
  138. testImplementation(libs.junit)
  139. implementation("com.baidu.lbsyun:BaiduMapSDK_Location_All:9.3.7")
  140. implementation("com.tencent.bugly:crashreport:latest.release")
  141. //第三方cardview
  142. implementation("org.linwg1988:lcardview:1.5.4")
  143. androidTestImplementation(libs.androidx.test.ext.junit)
  144. androidTestImplementation(libs.espresso.core)
  145. androidTestImplementation(platform(libs.compose.bom))
  146. androidTestImplementation(libs.ui.test.junit4)
  147. debugImplementation(libs.ui.tooling)
  148. debugImplementation(libs.ui.test.manifest)
  149. }