build.gradle 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Copyright (C) 2018 Drake, Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. apply plugin: "com.android.application"
  17. apply plugin: "kotlin-android"
  18. apply plugin: "kotlin-kapt"
  19. apply plugin: 'kotlinx-serialization'
  20. android {
  21. compileSdkVersion 30
  22. signingConfigs {
  23. signed {
  24. storeFile file("../signed")
  25. storePassword "s73dfyUxkjuq"
  26. keyAlias "key0"
  27. keyPassword "s73dfyUxkjuq"
  28. }
  29. }
  30. defaultConfig {
  31. applicationId "com.drake.net.sample"
  32. minSdkVersion 19
  33. targetSdkVersion 30
  34. versionCode 1
  35. multiDexEnabled true
  36. versionName "1.0"
  37. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  38. signingConfig signingConfigs.signed
  39. }
  40. buildTypes {
  41. release {
  42. minifyEnabled true
  43. proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
  44. }
  45. }
  46. dataBinding {
  47. enabled = true
  48. }
  49. kotlinOptions {
  50. jvmTarget = JavaVersion.VERSION_1_8
  51. }
  52. compileOptions {
  53. sourceCompatibility JavaVersion.VERSION_1_8
  54. targetCompatibility JavaVersion.VERSION_1_8
  55. }
  56. applicationVariants.all {
  57. it.outputs.each { output ->
  58. output.outputFileName = "net-sample.apk"
  59. }
  60. }
  61. }
  62. dependencies {
  63. implementation fileTree(dir: "libs", include: ["*.jar"])
  64. testImplementation "junit:junit:4.13.2"
  65. androidTestImplementation "androidx.test:runner:1.3.0"
  66. androidTestImplementation "androidx.test.espresso:espresso-core:3.3.0"
  67. implementation "androidx.appcompat:appcompat:1.3.1"
  68. implementation "androidx.core:core-ktx:1.3.2"
  69. implementation "androidx.constraintlayout:constraintlayout:2.0.4"
  70. implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  71. implementation "androidx.recyclerview:recyclerview:1.2.0"
  72. implementation "com.google.android.material:material:1.3.0"
  73. implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
  74. implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
  75. // ------------------------------网络请求-------------------------------------
  76. implementation project(path: ":net")
  77. implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
  78. implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutine_version" // 协程基础库
  79. implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutine_version"
  80. implementation "com.github.liangjingkanji:BRV:$brv_version" // 提供自动分页/缺省页/自动下拉刷新功能
  81. implementation "com.github.chuckerteam.chucker:library:3.5.2" // 通知栏监听网络日志
  82. // ------------------------------JSON解析-------------------------------------
  83. implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2" // JSON序列化库, 首选推荐使用
  84. implementation "org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.2.0" // protobuf序列化
  85. implementation "com.squareup.moshi:moshi-kotlin:1.8.0" // JSON序列化库, 强校验, JSON字段缺失会导致解析异常, 故不推荐
  86. kapt "com.squareup.moshi:moshi-kotlin-codegen:1.8.0"
  87. implementation 'com.google.code.gson:gson:2.8.6' // JSON序列化库, 会导致kotlin默认值无效, 故不推荐
  88. implementation 'com.alibaba:fastjson:1.2.73' // JSON序列化库, 会导致kotlin默认值无效(除非引入kt-reflect), 不推荐
  89. // ------------------------------其他库-------------------------------------
  90. implementation 'com.github.liangjingkanji:StatusBar:2.0.2' // 透明状态栏
  91. implementation 'com.github.liangjingkanji:debugkit:1.3.0' // 开发调试窗口工具
  92. implementation "com.github.liangjingkanji:Tooltip:1.2.2" // 吐司工具
  93. implementation 'com.github.liangjingkanji:Engine:0.0.67'
  94. }