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

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. }
  19. /*构建类型: 定义Gradle在构建阶段和打包应用时使用的某些属性*/
  20. buildTypes {
  21. release {
  22. minifyEnabled false
  23. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  24. }
  25. }
  26. //配置产品变种 与 构建变体
  27. //flavorDimensions :变种维度
  28. // flavorDimensions "version"
  29. // productFlavors{ //产品变种
  30. // demo{
  31. // dimension "version"
  32. // //applicationId后追加 .demo 也可以重新定义applicationId 属性
  33. // applicationIdSuffix ".demo"
  34. // versionNameSuffix "-demo"
  35. // }
  36. // full {
  37. // dimension "version"
  38. // applicationIdSuffix ".full"
  39. // versionNameSuffix '-full'
  40. // }
  41. // }
  42. //变体过滤器
  43. // variantFilter { variant ->
  44. // def names = variant.flavors*.name
  45. // if (name.contains("demo")){
  46. // setIgnore(true)
  47. // }
  48. // }
  49. compileOptions {
  50. coreLibraryDesugaringEnabled true //为了使用jdk8的脱糖属性
  51. sourceCompatibility JavaVersion.VERSION_1_8
  52. targetCompatibility JavaVersion.VERSION_1_8
  53. }
  54. kotlinOptions {
  55. jvmTarget = '1.8'
  56. }
  57. buildFeatures {
  58. viewBinding true
  59. dataBinding true
  60. }
  61. sourceSets {
  62. main {
  63. res.srcDirs("svg")
  64. }
  65. }
  66. }
  67. dependencies {
  68. implementation fileTree(include: ['*.jar', "*.aar"], dir: 'libs')
  69. // implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  70. implementation project(path: ':lib:common')
  71. // implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
  72. // implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
  73. // implementation 'androidx.appcompat:appcompat:1.2.0'
  74. // implementation 'com.google.android.material:material:1.3.0'
  75. // implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  76. // implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
  77. // implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
  78. rootProject.ext.dependencies_required.each { k, v -> implementation v }
  79. testImplementation rootProject.ext.dependencies_testImplementation.junit
  80. rootProject.ext.dependencies_androidTestImplementation.each { k, v -> androidTestImplementation v }
  81. def customDependencies = rootProject.ext.dependencies_custom
  82. //SmartRefreshLayout
  83. implementation customDependencies.SmartRefreshLayout
  84. implementation 'io.github.scwang90:refresh-header-classics:2.0.5' //经典刷新头
  85. //SqlCipher
  86. implementation customDependencies.SqlCipher
  87. //androidx-sqlite
  88. implementation customDependencies.Sqlite
  89. //Lottie
  90. implementation customDependencies.Lottie
  91. coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
  92. //Gson
  93. implementation customDependencies.Gson
  94. //protobuf
  95. implementation customDependencies.protobuf_java
  96. implementation customDependencies.protobuf_java_format
  97. //grpc
  98. implementation customDependencies.annotation_api
  99. implementation customDependencies.grpc_okhttp
  100. implementation customDependencies.grpc_android
  101. implementation customDependencies.grpc_protobuf
  102. implementation customDependencies.grpc_stub
  103. }