build.gradle 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. group = "com.atmob.map_amap_android"
  2. version = "1.0"
  3. buildscript {
  4. repositories {
  5. google()
  6. mavenCentral()
  7. }
  8. dependencies {
  9. classpath("com.android.tools.build:gradle:7.3.0")
  10. }
  11. }
  12. rootProject.allprojects {
  13. repositories {
  14. google()
  15. mavenCentral()
  16. }
  17. }
  18. // 加载 local.properties 文件
  19. def localProperties = new Properties()
  20. def localPropertiesFile = rootProject.file('local.properties')
  21. if (localPropertiesFile.exists()) {
  22. localPropertiesFile.withInputStream { stream ->
  23. localProperties.load(stream)
  24. }
  25. }
  26. // 读取变量
  27. def flutterSdk = localProperties.getProperty('flutter.sdk')
  28. apply plugin: "com.android.library"
  29. android {
  30. if (project.android.hasProperty("namespace")) {
  31. namespace = "com.atmob.map_amap_android"
  32. }
  33. compileSdk = 34
  34. buildFeatures {
  35. viewBinding true
  36. dataBinding true
  37. }
  38. compileOptions {
  39. sourceCompatibility = JavaVersion.VERSION_1_8
  40. targetCompatibility = JavaVersion.VERSION_1_8
  41. }
  42. defaultConfig {
  43. minSdk = 21
  44. }
  45. dependencies {
  46. //flutter
  47. compileOnly files("$flutterSdk/bin/cache/artifacts/engine/android-arm/flutter.jar")
  48. //AndroidX
  49. compileOnly "androidx.annotation:annotation:1.1.0"
  50. //constraintlayout
  51. implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  52. //高德地图
  53. implementation "com.amap.api:3dmap:9.7.0"
  54. implementation 'com.amap.api:search:9.7.0'
  55. //gson
  56. implementation "com.google.code.gson:gson:2.10"
  57. }
  58. testOptions {
  59. unitTests.all {
  60. testLogging {
  61. events "passed", "skipped", "failed", "standardOut", "standardError"
  62. outputs.upToDateWhen { false }
  63. showStandardStreams = true
  64. }
  65. }
  66. }
  67. }