build.gradle 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. //广告模块
  57. implementation "plus.ad:ad:2.9.7-SNAPSHOT"
  58. }
  59. testOptions {
  60. unitTests.all {
  61. testLogging {
  62. events "passed", "skipped", "failed", "standardOut", "standardError"
  63. outputs.upToDateWhen { false }
  64. showStandardStreams = true
  65. }
  66. }
  67. }
  68. configurations.configureEach {
  69. resolutionStrategy {
  70. // don't cache changing modules at all
  71. cacheChangingModulesFor 10, 'seconds'
  72. }
  73. }
  74. }