build.gradle 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. apply plugin: 'com.android.application'
  2. def releaseTime() {
  3. return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC"))
  4. }
  5. android {
  6. compileSdkVersion 29
  7. buildToolsVersion "29.0.2"
  8. defaultConfig {
  9. applicationId "com.dawangye2.app"
  10. minSdkVersion 21
  11. targetSdkVersion 28
  12. versionCode 1
  13. versionName "1.0"
  14. multiDexEnabled true
  15. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  16. javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
  17. }
  18. signingConfigs {
  19. config {
  20. keyAlias 'dawangye2'
  21. keyPassword 'dawangye'
  22. storeFile file('dawangye2.jks')
  23. storePassword 'dawangye'
  24. }
  25. }
  26. buildTypes {
  27. release {
  28. minifyEnabled true
  29. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  30. signingConfig signingConfigs.config
  31. }
  32. debug {
  33. minifyEnabled false
  34. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  35. signingConfig signingConfigs.config
  36. }
  37. android.applicationVariants.all { variant ->
  38. variant.outputs.all { output ->
  39. // 格式化输出 apk 名称
  40. output.outputFileName = "dwy2_v${variant.versionName}_${releaseTime()}.apk"
  41. }
  42. }
  43. }
  44. compileOptions {
  45. sourceCompatibility = 1.8
  46. targetCompatibility = 1.8
  47. }
  48. sourceSets {
  49. main {
  50. jniLibs.srcDirs = ['libs']
  51. }
  52. }
  53. repositories {
  54. flatDir {
  55. dirs 'libs'
  56. }
  57. }
  58. }
  59. dependencies {
  60. implementation fileTree(include: ['*.jar'], dir: 'libs')
  61. implementation 'androidx.appcompat:appcompat:1.1.0'
  62. implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  63. testImplementation 'junit:junit:4.12'
  64. androidTestImplementation 'androidx.test.ext:junit:1.1.1'
  65. androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
  66. implementation 'androidx.recyclerview:recyclerview:1.1.0'
  67. api 'com.lzy.net:okgo:3.0.4'
  68. api 'com.google.code.gson:gson:2.8.0'
  69. api 'com.jakewharton:butterknife:10.2.3'
  70. annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
  71. implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.50'
  72. implementation 'com.github.tbruyelle:rxpermissions:0.10.2'
  73. implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
  74. implementation 'com.polidea.rxandroidble2:rxandroidble:1.11.1'
  75. implementation 'androidx.cardview:cardview:1.0.0'
  76. /* implementation 'com.orhanobut:hawk:2.0.1'*/
  77. api 'com.kaopiz:kprogresshud:1.2.0'
  78. api 'com.contrarywind:wheelview:4.1.0'
  79. api 'com.github.SheHuan:NiceDialog:1.2.0'
  80. implementation 'com.github.zcweng:switch-button:0.0.3@aar'
  81. api 'com.tencent.bugly:crashreport:latest.release'
  82. // //其中latest.release指代最新Bugly SDK版本号,也可以指定明确的版本号,例如2.1.9
  83. api 'com.tencent.bugly:nativecrashreport:latest.release'
  84. // //其中latest.release指代最新Bugly NDK版本号,也可以指定明确的版本号,例如3.0
  85. implementation 'javax.annotation:javax.annotation-api:1.2'
  86. implementation "org.projectlombok:lombok:1.18.12"
  87. implementation 'org.greenrobot:eventbus:3.1.1'
  88. implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.2'
  89. implementation 'com.contrarywind:Android-PickerView:4.1.8'
  90. implementation 'com.github.bumptech.glide:glide:3.7.0'
  91. implementation 'io.github.xmaihh:serialport:2.1.1'
  92. implementation 'com.google.android.exoplayer:exoplayer-core:2.15.1'
  93. implementation 'com.google.android.exoplayer:exoplayer-ui:2.15.1'
  94. implementation 'com.android.support:multidex:1.0.3'
  95. //摄像头预览库
  96. implementation "androidx.camera:camera-core:1.3.0-alpha04"
  97. // CameraX Camera2 extensions[可选]拓展库可实现人像、HDR、夜间和美颜、滤镜但依赖于OEM
  98. implementation "androidx.camera:camera-camera2:1.3.0-alpha04"
  99. // CameraX Lifecycle library[可选]避免手动在生命周期释放和销毁数据
  100. implementation "androidx.camera:camera-lifecycle:1.3.0-alpha04"
  101. // CameraX View class[可选]最佳实践,最好用里面的PreviewView,它会自行判断用SurfaceView还是TextureView来实现
  102. implementation 'androidx.camera:camera-view:1.3.0-alpha04'
  103. implementation(name: 'printer-lib-3.1.6', ext: 'aar')
  104. implementation 'com.github.Jasonchenlijian:FastBle:2.4.0'
  105. }