build.gradle 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. // App前后台判断
  72. implementation "androidx.lifecycle:lifecycle-process:2.8.7"
  73. // Retrofit
  74. implementation('com.squareup.retrofit2:retrofit:2.9.0')
  75. implementation('com.squareup.retrofit2:converter-gson:2.9.0')
  76. implementation('com.squareup.okhttp3:logging-interceptor:3.4.1')
  77. // 协程
  78. implementation('org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0')
  79. implementation('org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1')
  80. // 使用拓展库
  81. implementation("androidx.lifecycle:lifecycle-extensions:2.2.0")
  82. // ViewModel拓展函数
  83. implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7")
  84. // 提供lifecycleScope支持
  85. implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")
  86. // LiveData拓展函数
  87. implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.7")
  88. implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.7")
  89. // Lottie动画
  90. implementation "com.airbnb.android:lottie:6.6.6"
  91. // Gson
  92. implementation "com.google.code.gson:gson:2.10"
  93. // CircleImageView
  94. implementation 'de.hdodenhof:circleimageview:3.1.0'
  95. // XPopup
  96. // implementation 'com.github.li-xiaojun:XPopup:2.10.0'
  97. // Android Util Code
  98. implementation 'com.blankj:utilcodex:1.31.1'
  99. // RecyclerView Adapter
  100. implementation 'me.drakeet.multitype:multitype:3.5.0'
  101. // OkHttp3
  102. implementation 'com.squareup.okhttp3:okhttp:3.12.0'
  103. // Glide
  104. implementation "com.github.bumptech.glide:glide:$glide_version"
  105. implementation "jp.wasabeef:glide-transformations:4.3.0"
  106. implementation "com.github.zjupure:webpdecoder:2.1.${glide_version}"
  107. // MagicIndicator ViewPager指示器
  108. implementation 'com.github.hackware1993:MagicIndicator:1.7.0'
  109. // 混淆配置
  110. implementation 'com.blankj:free-proguard:0.0.12'
  111. }
  112. testOptions {
  113. unitTests.all {
  114. useJUnitPlatform()
  115. testLogging {
  116. events "passed", "skipped", "failed", "standardOut", "standardError"
  117. outputs.upToDateWhen { false }
  118. showStandardStreams = true
  119. }
  120. }
  121. }
  122. }