build.gradle 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. dependencies {
  53. testImplementation("org.jetbrains.kotlin:kotlin-test")
  54. testImplementation("org.mockito:mockito-core:5.0.0")
  55. compileOnly(files("$flutterSdk/bin/cache/artifacts/engine/android-arm/flutter.jar"))
  56. // AppCompat
  57. implementation 'androidx.appcompat:appcompat:1.3.1'
  58. // Material
  59. implementation 'com.google.android.material:material:1.4.0'
  60. // RecyclerView
  61. implementation 'androidx.recyclerview:recyclerview:1.3.0'
  62. // ConstraintLayout
  63. implementation "androidx.constraintlayout:constraintlayout:2.1.4"
  64. // Gson
  65. implementation "com.google.code.gson:gson:2.10"
  66. // CircleImageView
  67. implementation 'de.hdodenhof:circleimageview:3.1.0'
  68. // XPopup
  69. // implementation 'com.github.li-xiaojun:XPopup:2.10.0'
  70. // Android Util Code
  71. implementation 'com.blankj:utilcodex:1.31.1'
  72. // RecyclerView Adapter
  73. implementation 'me.drakeet.multitype:multitype:3.5.0'
  74. }
  75. testOptions {
  76. unitTests.all {
  77. useJUnitPlatform()
  78. testLogging {
  79. events "passed", "skipped", "failed", "standardOut", "standardError"
  80. outputs.upToDateWhen {false}
  81. showStandardStreams = true
  82. }
  83. }
  84. }
  85. }