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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  17. }
  18. /*构建类型: 定义Gradle在构建阶段和打包应用时使用的某些属性*/
  19. buildTypes {
  20. release {
  21. minifyEnabled false
  22. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  23. }
  24. }
  25. //配置产品变种 与 构建变体
  26. //flavorDimensions :变种维度
  27. // flavorDimensions "version"
  28. // productFlavors{ //产品变种
  29. // demo{
  30. // dimension "version"
  31. // //applicationId后追加 .demo 也可以重新定义applicationId 属性
  32. // applicationIdSuffix ".demo"
  33. // versionNameSuffix "-demo"
  34. // }
  35. // full {
  36. // dimension "version"
  37. // applicationIdSuffix ".full"
  38. // versionNameSuffix '-full'
  39. // }
  40. // }
  41. //变体过滤器
  42. // variantFilter { variant ->
  43. // def names = variant.flavors*.name
  44. // if (name.contains("demo")){
  45. // setIgnore(true)
  46. // }
  47. // }
  48. compileOptions {
  49. sourceCompatibility JavaVersion.VERSION_1_8
  50. targetCompatibility JavaVersion.VERSION_1_8
  51. }
  52. kotlinOptions {
  53. jvmTarget = '1.8'
  54. }
  55. buildFeatures {
  56. viewBinding true
  57. dataBinding true
  58. }
  59. sourceSets {
  60. main {
  61. res.srcDirs("svg")
  62. }
  63. }
  64. }
  65. dependencies {
  66. implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  67. implementation project(path: ':lib:common')
  68. implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
  69. implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
  70. implementation 'androidx.appcompat:appcompat:1.2.0'
  71. implementation 'com.google.android.material:material:1.3.0'
  72. implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  73. rootProject.ext.dependencies_required.each{ k, v -> implementation v}
  74. testImplementation rootProject.ext.dependencies_testImplementation.junit
  75. rootProject.ext.dependencies_androidTestImplementation.each{ k,v -> androidTestImplementation v}
  76. def customDependencies = rootProject.ext.dependencies_custom
  77. //SmartRefreshLayout
  78. implementation customDependencies.SmartRefreshLayout
  79. implementation 'io.github.scwang90:refresh-header-classics:2.0.5' //经典刷新头
  80. //SqlCipher
  81. implementation customDependencies.SqlCipher
  82. //androidx-sqlite
  83. implementation customDependencies.Sqlite
  84. //Lottie
  85. implementation customDependencies.Lottie
  86. }