build.gradle 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. apply plugin: 'com.android.library'
  2. apply plugin: 'kotlin-android'
  3. apply plugin: 'kotlin-kapt'
  4. apply plugin: 'dagger.hilt.android.plugin'
  5. android {
  6. compileSdkVersion versions.compileSdk
  7. buildToolsVersion versions.buildToolsVersion
  8. defaultConfig {
  9. minSdkVersion versions.minSdk
  10. targetSdkVersion versions.targetSdk
  11. versionCode 1
  12. versionName "1.0"
  13. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  14. consumerProguardFiles 'consumer-rules.pro'
  15. multiDexEnabled true
  16. vectorDrawables.useSupportLibrary = true
  17. }
  18. buildTypes {
  19. release {
  20. minifyEnabled false
  21. multiDexKeepProguard file('multidex-config.pro')
  22. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  23. }
  24. debug {
  25. multiDexKeepProguard file('multidex-config.pro')
  26. }
  27. }
  28. compileOptions {
  29. sourceCompatibility JavaVersion.VERSION_1_8
  30. targetCompatibility JavaVersion.VERSION_1_8
  31. }
  32. kotlinOptions {
  33. freeCompilerArgs = ['-Xjvm-default=enable']
  34. jvmTarget = JavaVersion.VERSION_1_8
  35. }
  36. lintOptions {
  37. checkReleaseBuilds false
  38. }
  39. dexOptions {
  40. preDexLibraries true
  41. maxProcessCount 8
  42. }
  43. // dataBinding{
  44. // enabled = true
  45. // }
  46. }
  47. configurations.all {
  48. resolutionStrategy.force 'androidx.activity:activity:1.1.0'
  49. resolutionStrategy.force 'androidx.core:core:1.3.0'
  50. resolutionStrategy.force 'androidx.fragment:fragment:1.2.5'
  51. resolutionStrategy.force 'androidx.multidex:multidex:2.0.1'
  52. resolutionStrategy.force 'androidx.transition:transition:1.3.1'
  53. resolutionStrategy.force 'androidx.arch.core:core-common:2.1.0'
  54. resolutionStrategy.force 'androidx.arch.core:core-runtime:2.1.0'
  55. resolutionStrategy.force 'androidx.lifecycle:lifecycle-livedata:2.2.0'
  56. resolutionStrategy.force 'androidx.lifecycle:lifecycle-livedata-core:2.2.0'
  57. // resolutionStrategy.force 'androidx.databinding:databinding-adapters:4.1.1'
  58. }
  59. dependencies {
  60. api fileTree(dir: 'libs', include: ['*.jar'])
  61. api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  62. api project(':cs_router')
  63. //AndroidX
  64. api deps.android.appcompat
  65. api deps.android.constraint_layout
  66. api deps.android.recyclerview
  67. api deps.android.design
  68. api deps.android.multidex
  69. api deps.android.fragment_ktx //Fragment与Activity的ViewModel扩展(Hilt必须)
  70. //Kotlin相关
  71. api deps.android.kt_ktx
  72. api deps.android.ktx_coroutines_core
  73. api deps.android.ktx_coroutines_android
  74. api deps.android.lifecycle
  75. api deps.android.lifecycle_vm
  76. api deps.android.lifecycle_live
  77. api deps.android.lifecycle_scope
  78. //测试
  79. testImplementation deps.android.junit
  80. androidTestImplementation deps.android.test_junit
  81. androidTestImplementation deps.android.test_espresso
  82. //图片
  83. implementation deps.support.glide
  84. implementation deps.support.glide_annotation
  85. implementation deps.support.glide_integration
  86. kapt deps.support.glide_compiler
  87. //Hilt依赖与扩展
  88. implementation deps.support.hilt
  89. kapt deps.support.hilt_kapt
  90. implementation deps.support.hilt_vm
  91. kapt deps.support.hilt_vm_kapt
  92. //网络相关
  93. api deps.support.retrofit2
  94. api deps.support.retrofit_gson
  95. api deps.support.cookie_jar
  96. //其他依赖
  97. implementation deps.support.permission
  98. api deps.support.live_bus
  99. api deps.support.brvah
  100. //刷新布局
  101. api deps.support.smart_refresh_core
  102. api deps.support.smart_refresh_head
  103. //XPopup弹窗
  104. api deps.support.easy_adapter
  105. api(deps.support.xpopup) {
  106. exclude group: 'androidx.recyclerview'
  107. exclude group: 'androidx.appcompat'
  108. exclude group: 'com.google.android.material'
  109. }
  110. //图片选择:带luban,ucorp
  111. // api(deps.support.picture_selector) {
  112. // exclude group: 'androidx.recyclerview'
  113. // exclude group: 'androidx.appcompat'
  114. // exclude group: 'com.squareup.okio'
  115. // }
  116. }