configs.gradle 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. ext {
  2. // 测试服
  3. def SERVER_TYPE_TEST = "test"
  4. // 预发布服
  5. def SERVER_TYPE_PREVIEW = "pre"
  6. // 正式服
  7. def SERVER_TYPE_PRODUCT = "product"
  8. def taskName = project.gradle.startParameter.taskNames[0]
  9. if (taskName == null) {
  10. taskName = ""
  11. }
  12. // 打印当前执行的任务名称
  13. println "GradleLog TaskNameOutput " + taskName
  14. def serverType = SERVER_TYPE_PRODUCT
  15. if (taskName.endsWith("Debug")) {
  16. serverType = SERVER_TYPE_TEST
  17. } else if (taskName.endsWith("Preview")) {
  18. serverType = SERVER_TYPE_PREVIEW
  19. }
  20. // 从 Gradle 命令中读取参数配置,例如:./gradlew assembleRelease -P ServerType="test"
  21. if (project.hasProperty("ServerType")) {
  22. serverType = project.properties["ServerType"]
  23. }
  24. // 打印当前服务器配置
  25. println "GradleLog ServerTypeOutput " + serverType
  26. // 友盟 AppKey
  27. UMENG_APP_KEY = "61b1c29ee0f9bb492b8b5d9b"
  28. // QQ AppId
  29. QQ_APP_ID = ""
  30. // QQ Secret
  31. QQ_APP_SECRET = ""
  32. // 微信 AppId
  33. WX_APP_ID = "wx182f1f0cd7e46e13"
  34. // 微信 Secret
  35. WX_APP_SECRET = "8997764aaf76eb2ef2f8597bca7b045b"
  36. // 实战营
  37. Shi_Zhan_Ying = "gh_9a865fcbd4bf"
  38. // 争霸赛
  39. Zheng_Ba_Sai = "gh_ccc3d7c5cbe0"
  40. // 隐私政策
  41. Yin_Si_Zheng_Ce = "https://jiuweiyun.cn/ys/index.html#/"
  42. // 用户协议
  43. Yong_Hu_Xie_Yi = "https://jiuweiyun.cn/yhxy/index.html#/"
  44. // 身份证图片拼接地址
  45. // 七牛云地址
  46. IdCard_Qi_Niu_URl = "https://qny.d0w.cc"
  47. // 公司地址
  48. IdCard_URl = "http://api.app.jiuweiyun.cn"
  49. // 公司官网
  50. Website_URL = "https://app.dwbs.jiuweiyun.cn/"
  51. //测试服务器
  52. // HOST_URL = "http://test.woaidakele.cn/api/"
  53. // SHARE_GOODS = "http://weidian.woaidakele.cn/web/user#pages/index/index?store_id=%s&goods_id=%s"
  54. // SHARE_ORDER = "http://weidian.woaidakele.cn/web/user#pages/scan-order/scan-order?order_no=%s"
  55. //正式服务器
  56. // HOST_URL = "http://app.jiuweiyun.cn/api/"
  57. // SHARE_GOODS = "http://weidian.jiuweiyun.cn/web/user#pages/index/index?store_id=%s&goods_id=%s"
  58. // SHARE_ORDER = "http://weidian.jiuweiyun.cn/web/user#pages/scan-order/scan-order?order_no=%s"
  59. switch (serverType) {
  60. case SERVER_TYPE_TEST:
  61. case SERVER_TYPE_PREVIEW:
  62. LOG_ENABLE = true
  63. BUGLY_ID = ""
  64. if (serverType == SERVER_TYPE_PREVIEW) {
  65. HOST_URL = "http://app.jiuweiyun.cn/api/"
  66. //SHARE_GOODS = "http://weidian.woaidakele.cn/web/user#pages/index/index?store_id=%s&goods_id=%s"
  67. //SHARE_ORDER = "http://weidian.woaidakele.cn/web/user#pages/scan-order/scan-order?order_no=%s"
  68. } else {
  69. HOST_URL = "http://app.jiuweiyun.cn/api/"
  70. //SHARE_GOODS = "http://weidian.woaidakele.cn/web/user#pages/index/index?store_id=%s&goods_id=%s"
  71. //SHARE_ORDER = "http://weidian.woaidakele.cn/web/user#pages/scan-order/scan-order?order_no=%s"
  72. }
  73. break
  74. case SERVER_TYPE_PRODUCT:
  75. LOG_ENABLE = false
  76. BUGLY_ID = ""
  77. HOST_URL = "http://app.jiuweiyun.cn/api/"
  78. //SHARE_GOODS = "http://weidian.woaidakele.cn/web/user#pages/index/index?store_id=%s&goods_id=%s"
  79. //SHARE_ORDER = "http://weidian.woaidakele.cn/web/user#pages/scan-order/scan-order?order_no=%s"
  80. break
  81. }
  82. }