build.gradle 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. apply plugin: "com.android.application"
  2. apply plugin: "kotlin-android"
  3. apply plugin: "kotlin-kapt"
  4. apply plugin: 'kotlinx-serialization'
  5. android {
  6. compileSdkVersion 33
  7. signingConfigs {
  8. signed {
  9. storeFile file("../signed")
  10. storePassword "s73dfyUxkjuq"
  11. keyAlias "key0"
  12. keyPassword "s73dfyUxkjuq"
  13. }
  14. }
  15. defaultConfig {
  16. applicationId "com.drake.net.sample"
  17. minSdkVersion 19
  18. targetSdkVersion 33
  19. versionCode 1
  20. multiDexEnabled true
  21. versionName "1.0"
  22. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  23. signingConfig signingConfigs.signed
  24. }
  25. buildTypes {
  26. release {
  27. minifyEnabled true
  28. proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
  29. }
  30. }
  31. dataBinding {
  32. enabled = true
  33. }
  34. kotlinOptions {
  35. jvmTarget = JavaVersion.VERSION_1_8
  36. }
  37. compileOptions {
  38. sourceCompatibility JavaVersion.VERSION_1_8
  39. targetCompatibility JavaVersion.VERSION_1_8
  40. }
  41. applicationVariants.all {
  42. it.outputs.each { output ->
  43. output.outputFileName = "net-sample.apk"
  44. }
  45. }
  46. }
  47. dependencies {
  48. implementation fileTree(dir: "libs", include: ["*.jar"])
  49. testImplementation "junit:junit:4.13.2"
  50. androidTestImplementation "androidx.test:runner:1.3.0"
  51. androidTestImplementation "androidx.test.espresso:espresso-core:3.3.0"
  52. implementation "androidx.appcompat:appcompat:1.6.1"
  53. implementation "androidx.core:core-ktx:1.9.0"
  54. implementation "androidx.constraintlayout:constraintlayout:2.0.4"
  55. implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  56. implementation "androidx.recyclerview:recyclerview:1.2.0"
  57. implementation "com.google.android.material:material:1.3.0"
  58. implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
  59. implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
  60. // ------------------------------网络请求-------------------------------------
  61. implementation project(path: ":net")
  62. implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
  63. implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutine_version" // 协程基础库
  64. implementation "com.github.bumptech.glide:glide:4.11.0"
  65. implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutine_version"
  66. implementation "com.github.liangjingkanji:BRV:$brv_version" // 提供自动分页/缺省页/自动下拉刷新功能
  67. implementation "com.github.chuckerteam.chucker:library:3.5.2" // 通知栏监听网络日志
  68. // ------------------------------JSON解析-------------------------------------
  69. implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2" // JSON序列化库, 首选推荐使用
  70. implementation "org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.2.0" // protobuf序列化
  71. implementation "com.squareup.moshi:moshi-kotlin:1.14.0" // JSON序列化库, 强校验, JSON字段缺失会导致解析异常, 故不推荐
  72. implementation "org.jetbrains.kotlin:kotlin-reflect:1.7.10"
  73. implementation 'com.google.code.gson:gson:2.8.6' // JSON序列化库, 会导致kotlin默认值无效, 故不推荐
  74. implementation 'com.alibaba:fastjson:1.2.73' // JSON序列化库, 会导致kotlin默认值无效(除非引入kt-reflect), 不推荐
  75. // ------------------------------其他库-------------------------------------
  76. implementation 'com.github.liangjingkanji:StatusBar:2.0.2' // 透明状态栏
  77. implementation 'com.github.liangjingkanji:debugkit:1.3.0' // 开发调试窗口工具
  78. implementation "com.github.liangjingkanji:Tooltip:1.2.2" // 吐司工具
  79. implementation 'com.github.liangjingkanji:Engine:0.0.74'
  80. implementation "com.squareup.okhttp3:mockwebserver:4.10.0"
  81. implementation 'com.github.liangjingkanji:Serialize:3.0.1'
  82. debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.12'
  83. }