build.gradle 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. implementation "androidx.core:core:1.9.0"
  51. //constraintlayout
  52. implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  53. //高德地图
  54. // implementation "com.amap.api:3dmap:9.7.0"
  55. // implementation 'com.amap.api:search:9.7.0'
  56. implementation 'com.amap.api:3dmap-location-search:10.0.800_loc6.4.5_sea9.7.2'
  57. //gson
  58. implementation "com.google.code.gson:gson:2.10"
  59. }
  60. testOptions {
  61. unitTests.all {
  62. testLogging {
  63. events "passed", "skipped", "failed", "standardOut", "standardError"
  64. outputs.upToDateWhen { false }
  65. showStandardStreams = true
  66. }
  67. }
  68. }
  69. }