学考乐离线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.5KB

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