build.gradle 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. group = "com.atmob.keyboard_android"
  2. version = "1.0-SNAPSHOT"
  3. // 加载 local.properties 文件
  4. // 需要在 local.properties 文件中配置你的flutter的sdk目录,例如:flutter.sdk=C\:\\Users\\XM20240809\\fvm\\versions\\3.29.2
  5. def localProperties = new Properties()
  6. def localPropertiesFile = rootProject.file('local.properties')
  7. if (localPropertiesFile.exists()) {
  8. localPropertiesFile.withInputStream { stream ->
  9. localProperties.load(stream)
  10. }
  11. }
  12. // 读取变量
  13. def flutterSdk = localProperties.getProperty('flutter.sdk')
  14. buildscript {
  15. ext.kotlin_version = "1.8.22"
  16. repositories {
  17. maven { url 'https://jitpack.io' }
  18. google()
  19. mavenCentral()
  20. }
  21. dependencies {
  22. classpath("com.android.tools.build:gradle:8.7.0")
  23. classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
  24. }
  25. }
  26. allprojects {
  27. repositories {
  28. maven { url 'https://jitpack.io' }
  29. google()
  30. mavenCentral()
  31. }
  32. }
  33. apply plugin: "com.android.library"
  34. apply plugin: "kotlin-android"
  35. android {
  36. namespace = "com.atmob.keyboard_android"
  37. compileSdk = 35
  38. compileOptions {
  39. sourceCompatibility = JavaVersion.VERSION_11
  40. targetCompatibility = JavaVersion.VERSION_11
  41. }
  42. kotlinOptions {
  43. jvmTarget = JavaVersion.VERSION_11
  44. }
  45. sourceSets {
  46. main.java.srcDirs += "src/main/kotlin"
  47. test.java.srcDirs += "src/test/kotlin"
  48. }
  49. defaultConfig {
  50. minSdk = 21
  51. }
  52. buildFeatures {
  53. // 生成BuildConfig
  54. buildConfig true
  55. }
  56. def glide_version = '4.13.2'
  57. dependencies {
  58. testImplementation("org.jetbrains.kotlin:kotlin-test")
  59. testImplementation("org.mockito:mockito-core:5.0.0")
  60. compileOnly(files("$flutterSdk/bin/cache/artifacts/engine/android-arm/flutter.jar"))
  61. // AppCompat
  62. implementation 'androidx.appcompat:appcompat:1.3.1'
  63. // Material
  64. implementation 'com.google.android.material:material:1.4.0'
  65. // RecyclerView
  66. implementation 'androidx.recyclerview:recyclerview:1.3.0'
  67. // ConstraintLayout
  68. implementation "androidx.constraintlayout:constraintlayout:2.1.4"
  69. // 让Service支持Jetpack Lifecycle组件
  70. implementation "androidx.lifecycle:lifecycle-service:2.6.1"
  71. // Retrofit
  72. implementation('com.squareup.retrofit2:retrofit:2.9.0')
  73. implementation('com.squareup.retrofit2:converter-gson:2.9.0')
  74. implementation('com.squareup.okhttp3:logging-interceptor:3.4.1')
  75. // 协程
  76. implementation('org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0')
  77. implementation('org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1')
  78. // 使用拓展库
  79. implementation("androidx.lifecycle:lifecycle-extensions:2.2.0")
  80. // ViewModel拓展函数
  81. implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7")
  82. // 提供lifecycleScope支持
  83. implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")
  84. // LiveData拓展函数
  85. implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.7")
  86. implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.7")
  87. // Lottie动画
  88. implementation "com.airbnb.android:lottie:6.6.6"
  89. // Gson
  90. implementation "com.google.code.gson:gson:2.10"
  91. // CircleImageView
  92. implementation 'de.hdodenhof:circleimageview:3.1.0'
  93. // XPopup
  94. // implementation 'com.github.li-xiaojun:XPopup:2.10.0'
  95. // Android Util Code
  96. implementation 'com.blankj:utilcodex:1.31.1'
  97. // RecyclerView Adapter
  98. implementation 'me.drakeet.multitype:multitype:3.5.0'
  99. // OkHttp3
  100. implementation 'com.squareup.okhttp3:okhttp:3.12.0'
  101. // Glide
  102. implementation "com.github.bumptech.glide:glide:$glide_version"
  103. implementation "jp.wasabeef:glide-transformations:4.3.0"
  104. implementation "com.github.zjupure:webpdecoder:2.1.${glide_version}"
  105. // MagicIndicator ViewPager指示器
  106. implementation 'com.github.hackware1993:MagicIndicator:1.7.0'
  107. // 混淆配置
  108. implementation 'com.blankj:free-proguard:0.0.12'
  109. }
  110. testOptions {
  111. unitTests.all {
  112. useJUnitPlatform()
  113. testLogging {
  114. events "passed", "skipped", "failed", "standardOut", "standardError"
  115. outputs.upToDateWhen { false }
  116. showStandardStreams = true
  117. }
  118. }
  119. }
  120. }