build.gradle.kts 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. plugins {
  2. alias(libs.plugins.android.application)
  3. alias(libs.plugins.kotlin.android)
  4. alias(libs.plugins.kotlin.compose)
  5. }
  6. android {
  7. namespace = "com.example.pda"
  8. compileSdk = 35
  9. defaultConfig {
  10. applicationId = "com.example.pda"
  11. minSdk = 24
  12. targetSdk = 35
  13. versionCode = 1
  14. versionName = "1.0"
  15. testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
  16. }
  17. buildTypes {
  18. release {
  19. isMinifyEnabled = false
  20. proguardFiles(
  21. getDefaultProguardFile("proguard-android-optimize.txt"),
  22. "proguard-rules.pro"
  23. )
  24. }
  25. }
  26. compileOptions {
  27. sourceCompatibility = JavaVersion.VERSION_11
  28. targetCompatibility = JavaVersion.VERSION_11
  29. }
  30. kotlinOptions {
  31. jvmTarget = "11"
  32. }
  33. buildFeatures {
  34. compose = true
  35. }
  36. }
  37. dependencies {
  38. // 基础依赖
  39. implementation(libs.androidx.core.ktx)
  40. implementation(libs.androidx.lifecycle.runtime.ktx)
  41. implementation(libs.androidx.activity.compose)
  42. // Compose BOM(确保版本 ≥ 2023.08.00)
  43. implementation(platform("androidx.compose:compose-bom:2023.10.01"))
  44. implementation("androidx.compose.ui:ui")
  45. implementation("androidx.compose.ui:ui-graphics")
  46. implementation("androidx.compose.ui:ui-tooling-preview")
  47. implementation("androidx.compose.material3:material3")
  48. implementation ("androidx.compose.animation:animation:1.3.0")
  49. implementation ("androidx.compose.ui:ui:1.3.0")
  50. // 其他依赖...
  51. implementation(files("libs\\platform_sdk_v3.0.0514.jar"))
  52. implementation("androidx.navigation:navigation-compose:2.7.7")
  53. implementation("com.google.accompanist:accompanist-navigation-animation:0.28.0")
  54. // Retrofit
  55. implementation("com.squareup.retrofit2:retrofit:2.9.0")
  56. implementation("com.squareup.retrofit2:converter-gson:2.9.0")
  57. // OkHttp
  58. implementation("com.squareup.okhttp3:okhttp:4.10.0")
  59. implementation("com.squareup.okhttp3:logging-interceptor:4.10.0")
  60. // Coroutines
  61. implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
  62. implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
  63. // ViewModel
  64. implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2")
  65. // 测试依赖...
  66. testImplementation ("junit:junit:4.13.2")
  67. }