build.gradle 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. group = "com.atmob.channel.atmob_channel_reader"
  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.channel.atmob_channel_reader"
  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. testImplementation("junit:junit:4.13.2")
  51. testImplementation("org.mockito:mockito-core:5.0.0")
  52. //flutter
  53. compileOnly files("$flutterSdk/bin/cache/artifacts/engine/android-arm/flutter.jar")
  54. implementation "extra.pack:channel:1.1.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. }