build.gradle 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. group = "com.atmob.mobile_use_statistics"
  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. namespace = "com.atmob.mobile_use_statistics"
  31. compileSdk = 35
  32. compileOptions {
  33. sourceCompatibility = JavaVersion.VERSION_11
  34. targetCompatibility = JavaVersion.VERSION_11
  35. }
  36. defaultConfig {
  37. minSdk = 22
  38. }
  39. dependencies {
  40. //flutter
  41. compileOnly files("$flutterSdk/bin/cache/artifacts/engine/android-arm/flutter.jar")
  42. //AndroidX
  43. compileOnly "androidx.annotation:annotation:1.1.0"
  44. }
  45. testOptions {
  46. unitTests.all {
  47. testLogging {
  48. events "passed", "skipped", "failed", "standardOut", "standardError"
  49. outputs.upToDateWhen { false }
  50. showStandardStreams = true
  51. }
  52. }
  53. }
  54. }