build.gradle 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Top-level build file where you can add configuration options common to all sub-projects/modules.
  2. buildscript {
  3. repositories {
  4. google()
  5. maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
  6. mavenCentral()
  7. }
  8. dependencies {
  9. classpath 'com.android.tools.build:gradle:7.2.2'
  10. // NOTE: Do not place your application dependencies here; they belong
  11. // in the individual module build.gradle files
  12. }
  13. }
  14. allprojects {
  15. repositories {
  16. google()
  17. mavenCentral()
  18. maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
  19. maven { url 'http://developer.huawei.com/repo/' }
  20. maven { url "https://jitpack.io" }
  21. }
  22. }
  23. task clean(type: Delete) {
  24. delete rootProject.buildDir
  25. }
  26. ext {
  27. compileSdkVersion = 32
  28. minSdkVersion = 21
  29. targetSdkVersion = 32
  30. ndkAbis = [
  31. 'armeabi-v7a',
  32. 'x86',
  33. 'arm64-v8a',
  34. 'x86_64'
  35. ]
  36. AppKey = ''
  37. BaseUrl = ''
  38. }
  39. def loadLocalConfig() {
  40. String env = System.getProperty("env", "test")
  41. if (env != "test") env = "online"
  42. println "env=$env"
  43. def propertiesFile = file("config/${env}.properties")
  44. if (!propertiesFile.exists()) {
  45. println "Local properties don't exist."
  46. return
  47. }
  48. Properties config = new Properties()
  49. config.load(propertiesFile.newInputStream())
  50. this.AppKey = config.getProperty('APP_KEY')
  51. this.BaseUrl = config.getProperty('BASE_URL')
  52. }
  53. loadLocalConfig()