build.gradle 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'org.jetbrains.kotlin.android'
  3. android {
  4. compileSdkVersion 35
  5. buildToolsVersion '35.0.0'
  6. namespace 'com.YuyeTech.HeartRate'
  7. defaultConfig {
  8. minSdkVersion 21
  9. targetSdkVersion 32 //建议此属性值设为21 io.dcloud.PandoraEntry 作为apk入口时 必须设置 targetSDKVersion>=21 沉浸式才生效
  10. versionCode 26021104
  11. versionName "2.3.12"
  12. multiDexEnabled true
  13. ndk {
  14. abiFilters 'x86','x86_64','armeabi', 'armeabi-v7a','arm64-v8a'
  15. }
  16. compileOptions {
  17. sourceCompatibility JavaVersion.VERSION_1_8
  18. targetCompatibility JavaVersion.VERSION_1_8
  19. }
  20. //修改包名
  21. applicationId "com.YuyeTech.HeartRate"
  22. //修改app名字,string资源下不能包含"app_name"
  23. resValue "string", "app_name", "哔蹦健身"
  24. manifestPlaceholders = [
  25. appid:'__UNI__8D02B4B',
  26. adid:'0123456789'
  27. ]
  28. vectorDrawables {
  29. useSupportLibrary true
  30. }
  31. }
  32. signingConfigs {
  33. config {
  34. keyAlias 'key0'
  35. keyPassword 'heart123456'
  36. storeFile file('heartRateBand.jks')
  37. storePassword 'heart123456'
  38. v1SigningEnabled true
  39. v2SigningEnabled true
  40. }
  41. }
  42. buildTypes {
  43. release {
  44. signingConfig signingConfigs.config
  45. zipAlignEnabled false
  46. minifyEnabled false
  47. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  48. }
  49. debug {
  50. signingConfig signingConfigs.config
  51. zipAlignEnabled false
  52. minifyEnabled false
  53. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  54. }
  55. }
  56. //Add the following configuration
  57. lintOptions {
  58. checkReleaseBuilds false
  59. abortOnError false
  60. }
  61. //使用uniapp时,需复制下面代码
  62. /*代码开始*/
  63. aaptOptions {
  64. additionalParameters '--auto-add-overlay'
  65. //noCompress 'foo', 'bar'
  66. ignoreAssetsPattern "!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~"
  67. }
  68. compileOptions {
  69. sourceCompatibility JavaVersion.VERSION_1_8
  70. targetCompatibility JavaVersion.VERSION_1_8
  71. }
  72. /*代码结束*/
  73. //多渠道打包
  74. flavorDimensions "version"
  75. productFlavors {
  76. //离线测试包
  77. android_debug {
  78. dimension "version"
  79. manifestPlaceholders = [
  80. channel:'bbeng'
  81. ]
  82. }
  83. //哔蹦渠道
  84. app_bbeng {
  85. dimension "version"
  86. manifestPlaceholders = [
  87. channel:'bbeng'
  88. ]
  89. }
  90. //哔蹦pad渠道
  91. app_bbeng_pad {
  92. dimension "version"
  93. manifestPlaceholders = [
  94. channel:'pad'
  95. ]
  96. }
  97. //哔蹦测试渠道
  98. // BBengTest {
  99. // dimension "version"
  100. //
  101. // //修改包名
  102. // applicationId "com.YuyeTech.HeartRateTest"
  103. // //修改app名字,string资源下不能包含"app_name"
  104. // resValue "string", "app_name", "哔蹦健身测试版"
  105. //
  106. // manifestPlaceholders = [
  107. // channel:'BBengTest'
  108. // ]
  109. // }
  110. app_yyb {
  111. dimension "version"
  112. manifestPlaceholders = [
  113. channel:'yyb'
  114. ]
  115. }
  116. app_baidu{
  117. dimension "version"
  118. manifestPlaceholders = [
  119. channel:'baidu'
  120. ]
  121. }
  122. app_huawei {
  123. dimension "version"
  124. manifestPlaceholders = [
  125. channel:'huawei'
  126. ]
  127. }
  128. app_xiaomi {
  129. dimension "version"
  130. manifestPlaceholders = [
  131. channel:'xiaomi'
  132. ]
  133. }
  134. app_oppo {
  135. dimension "version"
  136. manifestPlaceholders = [
  137. channel:'oppo'
  138. ]
  139. }
  140. app_vivo {
  141. dimension "version"
  142. manifestPlaceholders = [
  143. channel:'vivo'
  144. ]
  145. }
  146. // app_360 {
  147. // dimension "version"
  148. // manifestPlaceholders = [
  149. // channel:'360'
  150. // ]
  151. // }
  152. }
  153. kotlinOptions {
  154. jvmTarget = '1.8'
  155. }
  156. buildFeatures {
  157. compose true
  158. }
  159. composeOptions {
  160. kotlinCompilerExtensionVersion '1.5.1'
  161. }
  162. packaging {
  163. resources {
  164. excludes += '/META-INF/{AL2.0,LGPL2.1}'
  165. }
  166. }
  167. /**
  168. * 打包导出apk时候的名字,或者各种服务的key配置等等
  169. * */
  170. applicationVariants.all { variant ->
  171. variant.outputs.all {
  172. if (variant.buildType.name == "release") {
  173. // 输出apk名称
  174. outputFileName = "${variant.flavorName}_v${variant.versionName}_${variant.versionCode}_${releaseTime()}.apk"
  175. } else {
  176. if(variant.flavorName == "android_debug"){
  177. outputFileName = "${variant.flavorName}.apk"
  178. }else{
  179. outputFileName = "${variant.flavorName}_v${variant.versionName}_${variant.versionCode}_${releaseTime()}_debug.apk"
  180. }
  181. }
  182. }
  183. }
  184. }
  185. //打包时间
  186. def static releaseTime() {
  187. return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC"))
  188. }
  189. repositories {
  190. flatDir {
  191. dirs 'libs'
  192. }
  193. }
  194. dependencies {
  195. implementation project(":myLockView")
  196. implementation project(":myWIFIView")
  197. implementation fileTree(dir: 'libs', include: ['*.jar'])
  198. implementation fileTree(dir: 'libs', include: ['*.aar'])
  199. debugImplementation fileTree(includes: ['*.jar', '*.aar'], dir: 'debug/libs')
  200. /*uniapp所需库-----------------------开始*/
  201. implementation 'androidx.recyclerview:recyclerview:1.1.0'
  202. implementation 'com.facebook.fresco:fresco:1.13.0'
  203. implementation "com.facebook.fresco:animated-gif:1.13.0"
  204. /*uniapp所需库-----------------------结束*/
  205. // 基座需要,必须添加
  206. implementation 'com.github.bumptech.glide:glide:4.9.0'
  207. implementation 'com.alibaba:fastjson:1.2.83'
  208. implementation 'androidx.webkit:webkit:1.5.0'
  209. implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
  210. implementation 'androidx.core:core:1.1.0'
  211. implementation "androidx.fragment:fragment:1.1.0"
  212. implementation 'androidx.appcompat:appcompat:1.1.0'
  213. // 添加uni-app插件
  214. implementation project(':uniplugin_module')
  215. implementation project(path: ':core')
  216. implementation project(path: ':ICDeviceManager')
  217. // uts依赖
  218. implementation "com.squareup.okhttp3:okhttp:3.12.12"
  219. implementation "androidx.core:core-ktx:1.6.0"
  220. implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.10"
  221. implementation "org.jetbrains.kotlin:kotlin-reflect:1.6.0"
  222. implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8"
  223. implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8"
  224. implementation "com.github.getActivity:XXPermissions:18.0"
  225. implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
  226. implementation 'androidx.activity:activity-compose:1.8.0'
  227. implementation platform('androidx.compose:compose-bom:2024.04.01')
  228. implementation 'androidx.compose.ui:ui'
  229. implementation 'androidx.compose.ui:ui-graphics'
  230. implementation 'androidx.compose.ui:ui-tooling-preview'
  231. implementation 'androidx.compose.material3:material3'
  232. androidTestImplementation platform('androidx.compose:compose-bom:2024.04.01')
  233. androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
  234. debugImplementation 'androidx.compose.ui:ui-tooling'
  235. debugImplementation 'androidx.compose.ui:ui-test-manifest'
  236. //自定义基座添加部分信息
  237. implementation 'com.squareup.okhttp3:okhttp:3.12.12'
  238. implementation 'com.squareup.okio:okio:1.15.0'
  239. }