build.gradle 1.8 KB

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