build.gradle 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. group = "com.atmob.flutter_umeng"
  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.flutter_umeng"
  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. //AndroidX
  55. compileOnly "androidx.core:core:1.13.1"
  56. //友盟统计
  57. implementation 'com.umeng.umsdk:common:9.6.7'
  58. implementation 'com.umeng.umsdk:asms:1.8.0'
  59. implementation 'com.umeng.umsdk:apm:1.9.4'
  60. //渠道包信息读取
  61. compileOnly "extra.pack:channel:1.1.0-SNAPSHOT"
  62. //lifecycle
  63. compileOnly "androidx.lifecycle:lifecycle-process:2.6.1"
  64. }
  65. testOptions {
  66. unitTests.all {
  67. testLogging {
  68. events "passed", "skipped", "failed", "standardOut", "standardError"
  69. outputs.upToDateWhen { false }
  70. showStandardStreams = true
  71. }
  72. }
  73. }
  74. }