build.gradle 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. apply from: "../lib_default_config.gradle"
  2. apply plugin: 'dagger.hilt.android.plugin'
  3. android {
  4. defaultConfig {
  5. //读取配置表的值
  6. boolean mIsReleaseUrl = rootProject.ext.isReleaseUrl
  7. String helpCenterUrl
  8. String qaWebUrl
  9. String partTimeCreditHomeUrl
  10. String partTimeCreditTransactionsUrl
  11. String partTimeCreditRulesUrl
  12. String partTimeTrainRuleUrl
  13. String partTimeTrainAnswerUrl
  14. String partTimeTrainResultUrl
  15. String partTimeTrainCertificateUrl
  16. //判断是正式环境还是测试环境
  17. if (mIsReleaseUrl) {
  18. String baseUrlRelese = rootProject.ext.baseUrl_relese
  19. buildConfigField 'String', 'Base_Url', "\"${baseUrlRelese}\""
  20. helpCenterUrl = rootProject.ext.help_center_relese_url
  21. qaWebUrl = rootProject.ext.parttime_qa_relese_url
  22. partTimeCreditHomeUrl = rootProject.ext.part_time_credit_home_relese_url
  23. partTimeCreditTransactionsUrl = rootProject.ext.part_time_credit_credit_transactions_relese_url
  24. partTimeCreditRulesUrl = rootProject.ext.part_time_credit_credit_rules_relese_url
  25. partTimeTrainRuleUrl = rootProject.ext.part_time_train_rule_relese_url
  26. partTimeTrainAnswerUrl = rootProject.ext.part_time_train_answer_relese_url
  27. partTimeTrainResultUrl = rootProject.ext.part_time_train_result_relese_url
  28. partTimeTrainCertificateUrl = rootProject.ext.part_time_train_certificate_relese_url
  29. } else {
  30. String baseUrlDev = rootProject.ext.baseUrl_dev
  31. buildConfigField 'String', 'Base_Url', "\"${baseUrlDev}\""
  32. helpCenterUrl = rootProject.ext.help_center_dev_url
  33. qaWebUrl = rootProject.ext.parttime_qa_dev_url
  34. partTimeCreditHomeUrl = rootProject.ext.part_time_credit_home_dev_url
  35. partTimeCreditTransactionsUrl = rootProject.ext.part_time_credit_credit_transactions_dev_url
  36. partTimeCreditRulesUrl = rootProject.ext.part_time_credit_credit_rules_dev_url
  37. partTimeTrainRuleUrl = rootProject.ext.part_time_train_rule_dev_url
  38. partTimeTrainAnswerUrl = rootProject.ext.part_time_train_answer_dev_url
  39. partTimeTrainResultUrl = rootProject.ext.part_time_train_result_dev_url
  40. partTimeTrainCertificateUrl = rootProject.ext.part_time_train_certificate_dev_url
  41. }
  42. buildConfigField 'String', 'Help_Center_URL', "\"${helpCenterUrl}\""
  43. buildConfigField 'String', 'Part_Time_QA_Url', "\"${qaWebUrl}\""
  44. buildConfigField 'String', 'Part_Time_Credit_Home_URL', "\"${partTimeCreditHomeUrl}\""
  45. buildConfigField 'String', 'Part_Time_Credit_Transaction_URL', "\"${partTimeCreditTransactionsUrl}\""
  46. buildConfigField 'String', 'Part_Time_Credit_Rules_URL', "\"${partTimeCreditRulesUrl}\""
  47. buildConfigField 'String', 'Part_Time_Train_Rule_URL', "\"${partTimeTrainRuleUrl}\""
  48. buildConfigField 'String', 'Part_Time_Train_Answer_URL', "\"${partTimeTrainAnswerUrl}\""
  49. buildConfigField 'String', 'Part_Time_Train_Result_URL', "\"${partTimeTrainResultUrl}\""
  50. buildConfigField 'String', 'Part_Time_Train_Certificate_URL', "\"${partTimeTrainCertificateUrl}\""
  51. }
  52. buildFeatures {
  53. dataBinding = true
  54. viewBinding = true
  55. }
  56. }
  57. dependencies {
  58. //底层
  59. api project(':cs_baselib')
  60. }