学考乐离线App
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 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. plugins {
  2. id 'com.android.application'
  3. id 'kotlin-android'
  4. id 'kotlin-kapt'
  5. }
  6. def androidConfig = rootProject.ext.android
  7. android {
  8. compileSdk androidConfig.compile_sdk_version
  9. buildToolsVersion androidConfig.build_tools_version
  10. defaultConfig {
  11. applicationId androidConfig.applicationId
  12. minSdk androidConfig.min_sdk_version
  13. targetSdk androidConfig.target_sdk_version
  14. versionCode androidConfig.version_code
  15. versionName androidConfig.version_name
  16. multiDexEnabled true //解决64k 分包限制
  17. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  18. javaCompileOptions {
  19. annotationProcessorOptions {
  20. arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
  21. }
  22. }
  23. }
  24. /*构建类型: 定义Gradle在构建阶段和打包应用时使用的某些属性*/
  25. buildTypes {
  26. release {
  27. minifyEnabled false
  28. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  29. }
  30. }
  31. //配置产品变种 与 构建变体
  32. //flavorDimensions :变种维度
  33. // flavorDimensions "version"
  34. // productFlavors{ //产品变种
  35. // demo{
  36. // dimension "version"
  37. // //applicationId后追加 .demo 也可以重新定义applicationId 属性
  38. // applicationIdSuffix ".demo"
  39. // versionNameSuffix "-demo"
  40. // }
  41. // full {
  42. // dimension "version"
  43. // applicationIdSuffix ".full"
  44. // versionNameSuffix '-full'
  45. // }
  46. // }
  47. //变体过滤器
  48. // variantFilter { variant ->
  49. // def names = variant.flavors*.name
  50. // if (name.contains("demo")){
  51. // setIgnore(true)
  52. // }
  53. // }
  54. compileOptions {
  55. coreLibraryDesugaringEnabled true //为了使用jdk8的脱糖属性
  56. sourceCompatibility JavaVersion.VERSION_1_8
  57. targetCompatibility JavaVersion.VERSION_1_8
  58. }
  59. kotlinOptions {
  60. jvmTarget = '1.8'
  61. }
  62. buildFeatures {
  63. viewBinding true
  64. dataBinding true
  65. }
  66. sourceSets {
  67. main {
  68. res.srcDirs("svg")
  69. }
  70. }
  71. }
  72. dependencies {
  73. implementation fileTree(include: ['*.jar', "*.aar"], dir: 'libs')
  74. // implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  75. implementation project(path: ':lib:common')
  76. implementation project(path: ':videoplayer')
  77. implementation 'androidx.appcompat:appcompat:1.2.0'
  78. implementation 'com.google.android.material:material:1.3.0'
  79. implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  80. // implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
  81. // implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
  82. // implementation 'androidx.appcompat:appcompat:1.2.0'
  83. // implementation 'com.google.android.material:material:1.3.0'
  84. // implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  85. // implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
  86. // implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
  87. rootProject.ext.dependencies_required.each { k, v -> implementation v }
  88. testImplementation rootProject.ext.dependencies_testImplementation.junit
  89. rootProject.ext.dependencies_androidTestImplementation.each { k, v -> androidTestImplementation v }
  90. def customDependencies = rootProject.ext.dependencies_custom
  91. //SmartRefreshLayout
  92. implementation customDependencies.SmartRefreshLayout
  93. implementation 'io.github.scwang90:refresh-header-classics:2.0.5' //经典刷新头
  94. //SqlCipher
  95. implementation customDependencies.SqlCipher
  96. //androidx-sqlite
  97. implementation customDependencies.Sqlite
  98. //Lottie
  99. implementation customDependencies.Lottie
  100. coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
  101. //Gson
  102. implementation customDependencies.Gson
  103. //protobuf
  104. implementation customDependencies.protobuf_java
  105. implementation customDependencies.protobuf_java_format
  106. //grpc
  107. implementation customDependencies.annotation_api
  108. implementation customDependencies.grpc_okhttp
  109. implementation customDependencies.grpc_android
  110. implementation customDependencies.grpc_protobuf
  111. implementation customDependencies.grpc_stub
  112. //XPopup
  113. implementation customDependencies.XPopup
  114. implementation customDependencies.XPopupExt
  115. //精美日历 calendarview
  116. implementation customDependencies.CalendarView
  117. // FlexBoxLayoutManager
  118. implementation customDependencies.FlexBoxLayoutManager
  119. //图标
  120. implementation customDependencies.Chart
  121. //Room
  122. implementation customDependencies.Room_Runtime
  123. kapt customDependencies.Room_Compiler
  124. //Paging
  125. // implementation customDependencies.Paging
  126. //Room_Paging
  127. // implementation(customDependencies.Room_Paging){
  128. // force = true
  129. // }
  130. // implementation "me.zhanghai.android.materialratingbar:library:1.4.0"
  131. implementation 'com.xl.ratingbar:ratingbar:0.1.1'
  132. }