build.gradle 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. group = "com.atmob.system_share"
  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. rootProject.allprojects {
  19. repositories {
  20. google()
  21. mavenCentral()
  22. }
  23. }
  24. // 加载 local.properties 文件
  25. def localProperties = new Properties()
  26. def localPropertiesFile = rootProject.file('local.properties')
  27. if (localPropertiesFile.exists()) {
  28. localPropertiesFile.withInputStream { stream ->
  29. localProperties.load(stream)
  30. }
  31. }
  32. // 读取变量
  33. def flutterSdk = localProperties.getProperty('flutter.sdk')
  34. apply plugin: "com.android.library"
  35. android {
  36. if (project.android.hasProperty("namespace")) {
  37. namespace = "com.atmob.system_share"
  38. }
  39. compileSdk = 34
  40. compileOptions {
  41. sourceCompatibility = JavaVersion.VERSION_1_8
  42. targetCompatibility = JavaVersion.VERSION_1_8
  43. }
  44. defaultConfig {
  45. minSdk = 21
  46. }
  47. dependencies {
  48. //flutter
  49. compileOnly files("$flutterSdk/bin/cache/artifacts/engine/android-arm/flutter.jar")
  50. //AndroidX
  51. compileOnly "androidx.annotation:annotation:1.1.0"
  52. //AndroidX
  53. compileOnly "androidx.core:core:1.13.1"
  54. }
  55. testOptions {
  56. unitTests.all {
  57. testLogging {
  58. events "passed", "skipped", "failed", "standardOut", "standardError"
  59. outputs.upToDateWhen { false }
  60. showStandardStreams = true
  61. }
  62. }
  63. }
  64. }