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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. coreLibraryDesugaringEnabled true //为了使用jdk8的脱糖属性
  50. sourceCompatibility JavaVersion.VERSION_1_8
  51. targetCompatibility JavaVersion.VERSION_1_8
  52. }
  53. kotlinOptions {
  54. jvmTarget = '1.8'
  55. }
  56. buildFeatures {
  57. viewBinding true
  58. dataBinding true
  59. }
  60. sourceSets {
  61. main {
  62. res.srcDirs("svg")
  63. }
  64. }
  65. }
  66. dependencies {
  67. implementation fileTree(include: ['*.jar',"*.aar"], dir: 'libs')
  68. // implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  69. implementation project(path: ':lib:common')
  70. // implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
  71. // implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
  72. // implementation 'androidx.appcompat:appcompat:1.2.0'
  73. // implementation 'com.google.android.material:material:1.3.0'
  74. // implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  75. // implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
  76. // implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
  77. rootProject.ext.dependencies_required.each{ k, v -> implementation v}
  78. testImplementation rootProject.ext.dependencies_testImplementation.junit
  79. rootProject.ext.dependencies_androidTestImplementation.each{ k,v -> androidTestImplementation v}
  80. def customDependencies = rootProject.ext.dependencies_custom
  81. //SmartRefreshLayout
  82. implementation customDependencies.SmartRefreshLayout
  83. implementation 'io.github.scwang90:refresh-header-classics:2.0.5' //经典刷新头
  84. //SqlCipher
  85. implementation customDependencies.SqlCipher
  86. //androidx-sqlite
  87. implementation customDependencies.Sqlite
  88. //Lottie
  89. implementation customDependencies.Lottie
  90. coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
  91. //Gson
  92. implementation customDependencies.Gson
  93. }