build.gradle 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. jcenter()
  7. }
  8. dependencies {
  9. classpath 'com.android.tools.build:gradle:4.0.1'
  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. jcenter()
  22. }
  23. }
  24. task clean(type: Delete) {
  25. delete rootProject.buildDir
  26. }
  27. ext {
  28. compileSdkVersion = 31
  29. buildToolsVersion = "30.0.0"
  30. minSdkVersion = 21
  31. targetSdkVersion = 30
  32. ndkAbis = [
  33. 'armeabi-v7a',
  34. 'x86',
  35. 'arm64-v8a',
  36. 'x86_64'
  37. ]
  38. AppKey = ''
  39. BaseUrl = ''
  40. }
  41. def loadLocalConfig() {
  42. String env = System.getProperty("env", "test")
  43. if (env != "test") env = "online"
  44. println "env=$env"
  45. def propertiesFile = file("config/${env}.properties")
  46. if (!propertiesFile.exists()) {
  47. println "Local properties don't exist."
  48. return
  49. }
  50. Properties config = new Properties()
  51. config.load(propertiesFile.newInputStream())
  52. this.AppKey = config.getProperty('APP_KEY')
  53. this.BaseUrl = config.getProperty('BASE_URL')
  54. }
  55. loadLocalConfig()