build.gradle 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. google()
  18. mavenCentral()
  19. }
  20. dependencies {
  21. classpath("com.android.tools.build:gradle:8.7.0")
  22. classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
  23. }
  24. }
  25. allprojects {
  26. repositories {
  27. google()
  28. mavenCentral()
  29. }
  30. }
  31. apply plugin: "com.android.library"
  32. apply plugin: "kotlin-android"
  33. android {
  34. namespace = "com.atmob.keyboard_android"
  35. compileSdk = 35
  36. compileOptions {
  37. sourceCompatibility = JavaVersion.VERSION_11
  38. targetCompatibility = JavaVersion.VERSION_11
  39. }
  40. kotlinOptions {
  41. jvmTarget = JavaVersion.VERSION_11
  42. }
  43. sourceSets {
  44. main.java.srcDirs += "src/main/kotlin"
  45. test.java.srcDirs += "src/test/kotlin"
  46. }
  47. defaultConfig {
  48. minSdk = 21
  49. }
  50. dependencies {
  51. testImplementation("org.jetbrains.kotlin:kotlin-test")
  52. testImplementation("org.mockito:mockito-core:5.0.0")
  53. compileOnly(files("$flutterSdk/bin/cache/artifacts/engine/android-arm/flutter.jar"))
  54. // RecyclerView
  55. implementation 'androidx.recyclerview:recyclerview:1.3.0'
  56. // ConstraintLayout
  57. implementation "androidx.constraintlayout:constraintlayout:2.1.4"
  58. // Gson
  59. implementation "com.google.code.gson:gson:2.10"
  60. // CircleImageView
  61. implementation 'de.hdodenhof:circleimageview:3.1.0'
  62. }
  63. testOptions {
  64. unitTests.all {
  65. useJUnitPlatform()
  66. testLogging {
  67. events "passed", "skipped", "failed", "standardOut", "standardError"
  68. outputs.upToDateWhen {false}
  69. showStandardStreams = true
  70. }
  71. }
  72. }
  73. }