build.gradle 6.6 KB

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