build.gradle 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. plugins {
  2. id 'com.android.application'
  3. }
  4. android {
  5. compileSdkVersion rootProject.ext.android["compileSdkVersion"]
  6. buildToolsVersion rootProject.ext.android["buildToolsVersion"]
  7. defaultConfig {
  8. applicationId rootProject.ext.android["applicationId"]
  9. minSdkVersion rootProject.ext.android["minSdkVersion"]
  10. targetSdkVersion rootProject.ext.android["targetSdkVersion"]
  11. versionCode rootProject.ext.android["versionCode"]
  12. versionName rootProject.ext.android["versionName"]
  13. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  14. flavorDimensions "versionCode"
  15. }
  16. signingConfigs {
  17. debug {
  18. storeFile file('./src/main/jks/hh-face.jks')
  19. storePassword 'Nqj##117521'
  20. keyAlias 'hemile'
  21. keyPassword 'Nqj##117521'
  22. }
  23. release {
  24. storeFile file('./src/main/jks/hh-face.jks')
  25. storePassword 'Nqj##117521'
  26. keyAlias 'hemile'
  27. keyPassword 'Nqj##117521'
  28. }
  29. }
  30. buildTypes {
  31. release {
  32. // 服务器地址
  33. buildConfigField("String", "BASE_URL", "\"https://hhomc.hz-hanghui.com:8096/\"")
  34. buildConfigField("String", "BASE_URL_WEBSOCKET", "\"wss://hhomc.hz-hanghui.com:18096/\"")
  35. buildConfigField("String", "BASE_API_URL", "\"\"")
  36. buildConfigField("String", "LOG_FILE_AROME", "\"/storage/emulated/0/Android/data/com.hh.arome/files\"")
  37. buildConfigField("String", "PACKAGE_NAME_AROME", "\"com.hh.arome\"")
  38. resValue "string", "app_name", "蚂蚁N年陈"
  39. signingConfig signingConfigs.release
  40. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  41. shrinkResources false
  42. minifyEnabled false
  43. zipAlignEnabled true
  44. debuggable true
  45. jniDebuggable true
  46. testCoverageEnabled false
  47. // 3.0后的配置
  48. applicationVariants.all { variant ->
  49. variant.outputs.all { output ->
  50. def outputFile = output.outputFile
  51. if (outputFile != null && outputFile.name.endsWith('.apk')) {
  52. // 输出apk名称为jjb_v1.0_wandoujia.apk
  53. def fileName_new = "hhomc_v${defaultConfig.versionName}_${variant.productFlavors[0].name}.apk"
  54. outputFileName = fileName_new
  55. }
  56. }
  57. }
  58. }
  59. yufabu {
  60. applicationIdSuffix ".yufabu"
  61. buildConfigField("String", "BASE_URL", "\"http://192.168.11.9:9086/\"")
  62. buildConfigField("String", "BASE_URL_WEBSOCKET", "\"ws://192.168.11.9:19086/\"")
  63. buildConfigField("String", "BASE_API_URL", "\"\"")
  64. buildConfigField("String", "LOG_FILE_AROME", "\"/storage/emulated/0/Android/data/com.hh.arome.yufabu/files\"")
  65. buildConfigField("String", "PACKAGE_NAME_AROME", "\"com.hh.arome.yufabu\"")
  66. // 测试的IM信息
  67. // buildConfigField("int", "TIM_SDKAPPID", "1400803088")
  68. // buildConfigField("String", "TIM_SECRETKEY", "\"f942e1545dd5465c6d54fe68d2c42d9af424a2e7f3ed84133bc2f7b40191b271\"")
  69. resValue "string", "app_name", "测试HHOMC"
  70. minifyEnabled false
  71. shrinkResources false
  72. jniDebuggable true
  73. debuggable true
  74. signingConfig signingConfigs.release
  75. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  76. }
  77. debug {
  78. applicationIdSuffix ".test"
  79. buildConfigField("String", "BASE_URL", "\"http://192.168.11.9:9086/\"")
  80. buildConfigField("String", "BASE_URL_WEBSOCKET", "\"ws://192.168.11.9:19086/\"")
  81. buildConfigField("String", "BASE_API_URL", "\"\"")
  82. buildConfigField("String", "LOG_FILE_AROME", "\"/storage/emulated/0/Android/data/com.hh.arome.test/files\"")
  83. buildConfigField("String", "PACKAGE_NAME_AROME", "\"com.hh.arome.test\"")
  84. resValue "string", "app_name", "开发HHOMC"
  85. minifyEnabled false
  86. shrinkResources false
  87. jniDebuggable true
  88. debuggable true
  89. signingConfig signingConfigs.release
  90. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  91. }
  92. }
  93. // 与buildTypes中输出签名后的apk对应
  94. productFlavors {
  95. app {}
  96. }
  97. productFlavors.all {
  98. flavor -> flavor.manifestPlaceholders = [CHANNEL_VALUE: name]
  99. }
  100. dexOptions {
  101. javaMaxHeapSize "4g"
  102. }
  103. repositories {
  104. flatDir {
  105. dirs 'libs'
  106. }
  107. }
  108. sourceSets {
  109. main {
  110. jniLibs.srcDirs = ['libs']
  111. }
  112. }
  113. compileOptions {
  114. sourceCompatibility JavaVersion.VERSION_1_8
  115. targetCompatibility JavaVersion.VERSION_1_8
  116. }
  117. }
  118. dependencies {
  119. implementation 'androidx.appcompat:appcompat:1.1.0'
  120. implementation 'com.google.android.material:material:1.1.0'
  121. implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  122. testImplementation 'junit:junit:4.+'
  123. androidTestImplementation 'androidx.test.ext:junit:1.1.1'
  124. androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
  125. // 添加base依赖
  126. implementation project(path: ':lib_base')
  127. // 重启设备
  128. implementation files('libs/PosUtil.jar')
  129. implementation 'com.neovisionaries:nv-websocket-client:2.2'
  130. implementation 'org.java-websocket:Java-WebSocket:1.3.7'
  131. implementation 'com.google.code.gson:gson:2.8.8'
  132. // okHttp
  133. // implementation 'com.squareup.okhttp3:okhttp:3.4.1'
  134. // implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
  135. implementation 'com.yaoxiaowen:download:1.4.1'
  136. implementation 'com.alibaba:fastjson:1.2.76'
  137. }