build.gradle 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. // Gson
  72. implementation "com.google.code.gson:gson:2.10"
  73. // CircleImageView
  74. implementation 'de.hdodenhof:circleimageview:3.1.0'
  75. // XPopup
  76. // implementation 'com.github.li-xiaojun:XPopup:2.10.0'
  77. // Android Util Code
  78. implementation 'com.blankj:utilcodex:1.31.1'
  79. // RecyclerView Adapter
  80. implementation 'me.drakeet.multitype:multitype:3.5.0'
  81. // OkHttp3
  82. implementation 'com.squareup.okhttp3:okhttp:3.12.0'
  83. // Glide
  84. implementation "com.github.bumptech.glide:glide:$glide_version"
  85. implementation "jp.wasabeef:glide-transformations:4.3.0"
  86. implementation "com.github.zjupure:webpdecoder:2.1.${glide_version}"
  87. // MagicIndicator ViewPager指示器
  88. implementation 'com.github.hackware1993:MagicIndicator:1.7.0'
  89. }
  90. testOptions {
  91. unitTests.all {
  92. useJUnitPlatform()
  93. testLogging {
  94. events "passed", "skipped", "failed", "standardOut", "standardError"
  95. outputs.upToDateWhen { false }
  96. showStandardStreams = true
  97. }
  98. }
  99. }
  100. }