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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // 定义适用于所有模块的依赖项 Top-level build file where you can add configuration options common to all sub-projects/modules.
  2. buildscript {
  3. repositories {
  4. google()
  5. mavenCentral()
  6. maven { url 'https://jitpack.io' }
  7. }
  8. dependencies {
  9. classpath "com.android.tools.build:gradle:7.0.1"
  10. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20"
  11. // NOTE: Do not place your application dependencies here; they belong
  12. // in the individual module build.gradle files
  13. }
  14. }
  15. task clean(type: Delete) {
  16. delete rootProject.buildDir
  17. }
  18. //在项目级别定义某些属性并在所有模块之间共享这些属性
  19. ext {
  20. android = [
  21. compile_sdk_version: 31, //使用rootProject.ext.android.compile_sdk_version
  22. build_tools_version: "30.0.2",
  23. min_sdk_version : 21,
  24. target_sdk_version : 31,
  25. version_code : 100,
  26. version_name : "100",
  27. applicationId : "com.xkl.cdl"
  28. ]
  29. versions = [
  30. core_ktx_version : "1.7.0",
  31. appcompat_version: "1.4.1",
  32. material_version : "1.3.0",
  33. lifecycle_version: "2.5.0-alpha02",
  34. glide_version : "4.11.0",
  35. ]
  36. //必须依赖
  37. dependencies_required = [
  38. //为属于Android框架的通用库提供扩展程序
  39. core_ktx : "androidx.core:core-ktx:${versions.core_ktx_version}",
  40. //Androidx 依赖
  41. appcompat : "androidx.appcompat:appcompat:${versions.appcompat_version}",
  42. //material_design
  43. material : "com.google.android.material:material:${versions.material_version}",
  44. //constraintlayout
  45. constraintlayout : "androidx.constraintlayout:constraintlayout:2.0.4",
  46. //lifecycle
  47. // lifecycle : "androidx.lifecycle:lifecycle-runtime-ktx:${versions.lifecycle_version}",
  48. // //lifecycle saved state module for viewmodel
  49. //// lifecycle_viewmodel_savestate: "androidx.lifecycle:lifecycle-viewmodel-savedstate:${versions.lifecycle_version}",
  50. // //ViewModel
  51. // viewmodel : "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.lifecycle_version}",
  52. // //livedata
  53. // livedata : "androidx.lifecycle:lifecycle-livedata-ktx:${versions.lifecycle_version}",
  54. //java8 lifecycle_compiler
  55. // lifecycle_compiler : "androidx.lifecycle:lifecycle-common-java8:${versions.lifecycle_version}"
  56. ]
  57. dependencies_testImplementation = [
  58. junit: "junit:junit:4.+"
  59. ]
  60. dependencies_androidTestImplementation = [
  61. test_ext_junit : "androidx.test.ext:junit:1.1.2",
  62. test_espresson_core: "androidx.test.espresso:espresso-core:3.3.0"
  63. ]
  64. //依赖项
  65. dependencies_custom = [
  66. //设置状态栏和导航栏的框架 https://github.com/Zackratos/UltimateBarX
  67. UltimateBarX: "com.gitee.zackratos:UltimateBarX:0.8.0",
  68. //Glide 依赖和配置
  69. Glide : "com.github.bumptech.glide:glide:${versions.glide_version}",
  70. GlideCompiler : "com.github.bumptech.glide:compiler:${versions.glide_version}",
  71. //Glide translation
  72. GlideTranslation: "jp.wasabeef:glide-transformations:4.3.0",
  73. //Activity_ktx Activity扩展
  74. Activity_ktx : "androidx.activity:activity-ktx:1.4.0",
  75. ]
  76. }