build.gradle 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. group = "com.atmob.flutter_ad"
  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_ad"
  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 "androidx.appcompat:appcompat:1.6.1"
  55. implementation "androidx.recyclerview:recyclerview:1.3.0"
  56. implementation "androidx.constraintlayout:constraintlayout:2.1.4"
  57. // Atmob Ad
  58. implementation "plus.ad:mediation:3.0.8.0-SNAPSHOT" //广告聚合模块
  59. implementation("plus.ad:mediation-gromore:6.6.0.7.1-SNAPSHOT") {
  60. exclude group: 'plus.bytedance', module: 'mediation-adscope'
  61. } //Gromore adapter
  62. implementation("plus.ad:mediation-taku:6.3.50.1-SNAPSHOT") {
  63. exclude group: 'plus.taku', module: 'network-adscope'
  64. } //Taku adapter
  65. implementation "plus.ad:mediation-tobid:4.2.15.1-SNAPSHOT" //Tobid adapter
  66. }
  67. testOptions {
  68. unitTests.all {
  69. testLogging {
  70. events "passed", "skipped", "failed", "standardOut", "standardError"
  71. outputs.upToDateWhen { false }
  72. showStandardStreams = true
  73. }
  74. }
  75. }
  76. configurations.configureEach {
  77. resolutionStrategy {
  78. // don't cache changing modules at all
  79. cacheChangingModulesFor 10, 'seconds'
  80. }
  81. }
  82. }