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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. }
  60. dependencies {
  61. implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  62. implementation project(path: ':lib:common')
  63. rootProject.ext.dependencies_required.each{ k, v -> implementation v}
  64. testImplementation rootProject.ext.dependencies_testImplementation.junit
  65. rootProject.ext.dependencies_androidTestImplementation.each{ k,v -> androidTestImplementation v}
  66. // kapt rootProject.ext.dependencies_kapt.lifecycle_compiler
  67. def lifecycle_version = "2.5.0-alpha02"
  68. def arch_version = "2.1.0"
  69. //
  70. // // ViewModel
  71. // implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
  72. // // ViewModel utilities for Compose
  73. // implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycle_version"
  74. // // LiveData
  75. // implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
  76. // // Lifecycles only (without ViewModel or LiveData)
  77. // implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
  78. //
  79. // // Saved state module for ViewModel
  80. // implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle_version"
  81. //
  82. // // Annotation processor
  83. //// kapt "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
  84. // // alternately - if using Java8, use the following instead of lifecycle-compiler
  85. // implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
  86. // // optional - helpers for implementing LifecycleOwner in a Service
  87. // implementation "androidx.lifecycle:lifecycle-service:$lifecycle_version"
  88. //
  89. // // optional - ProcessLifecycleOwner provides a lifecycle for the whole application process
  90. // implementation "androidx.lifecycle:lifecycle-process:$lifecycle_version"
  91. //
  92. // // optional - ReactiveStreams support for LiveData
  93. // implementation "androidx.lifecycle:lifecycle-reactivestreams-ktx:$lifecycle_version"
  94. //
  95. // // optional - Test helpers for LiveData
  96. // testImplementation "androidx.arch.core:core-testing:$arch_version"
  97. }