build.gradle 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. apply plugin: 'com.android.application'
  2. android {
  3. useLibrary 'org.apache.http.legacy'
  4. compileSdkVersion 28
  5. buildToolsVersion "29.0.3"
  6. defaultConfig {
  7. applicationId "cn.net.caoyao.cpzshandset"
  8. minSdkVersion 16
  9. targetSdkVersion 28
  10. versionCode 1
  11. versionName "1.0.0"
  12. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  13. multiDexEnabled true
  14. // ndk {
  15. // abiFilters "armeabi", "armeabi-v7a"
  16. ////// 指定要ndk需要兼容的架构(这样其他依赖包里mips,x86,armeabi,arm-v8之类的so会被过滤掉)
  17. // }
  18. }
  19. // splits {
  20. // abi {
  21. // enable true
  22. // reset()
  23. // include 'x86', 'armeabi-v7a'
  24. // universalApk true
  25. // }
  26. // }
  27. signingConfigs {
  28. release {
  29. storeFile file('./zhongcaoyao.jks')
  30. // storeFile file('./liquidgas.jks')
  31. keyAlias "zhongcaoyao"
  32. keyPassword "zhongcaoyao2024"
  33. storePassword "zhongcaoyao2024"
  34. }
  35. }
  36. buildTypes {
  37. release {
  38. signingConfig signingConfigs.release
  39. minifyEnabled false
  40. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  41. }
  42. debug {
  43. signingConfig signingConfigs.release
  44. }
  45. android.applicationVariants.all { variant ->
  46. variant.outputs.all {
  47. def fileName = "中草药_v${defaultConfig.versionName}_${variant.name}_${releaseTime()}.apk"
  48. outputFileName = fileName
  49. }
  50. }
  51. }
  52. lintOptions {
  53. checkReleaseBuilds false
  54. abortOnError false
  55. }
  56. packagingOptions {
  57. exclude 'META-INF/DEPENDENCIES'
  58. // exclude 'META-INF/NOTICE'
  59. // exclude 'META-INF/LICENSE'
  60. // exclude 'META-INF/LICENSE.txt'
  61. // exclude 'META-INF/NOTICE.txt'
  62. }
  63. }
  64. //生成打包时间
  65. static def releaseTime() {
  66. def date = new Date()
  67. def formattedDate = date.format('yyyy-MM-dd-HHmmss')
  68. return formattedDate
  69. }
  70. dependencies {
  71. implementation fileTree(include: ['*.jar'], dir: 'libs')
  72. implementation 'com.android.support.constraint:constraint-layout:2.0.4'
  73. testImplementation 'junit:junit:4.12'
  74. implementation 'com.android.support:appcompat-v7:26.0.0'
  75. // implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
  76. implementation files('libs/scan.jar')
  77. implementation files('libs/core_3.0.1.jar')
  78. implementation files('libs/commons-jymf-label-4.0.jar')
  79. implementation files('libs/httpclient-4.5.13.jar')
  80. implementation files('libs/httpcore-4.4.13.jar')
  81. implementation 'com.github.ctiao:ndkbitmap-armv5:0.9.21'
  82. implementation 'com.github.ctiao:ndkbitmap-x86:0.9.21'
  83. implementation 'com.facebook.stetho:stetho:1.3.1'
  84. implementation 'com.android.support:design:28.0.0'
  85. //Retrofit所需要的依赖*****
  86. implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
  87. //retrofit2
  88. implementation 'com.squareup.retrofit2:retrofit:2.4.0'
  89. implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
  90. implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
  91. //rxjava
  92. implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
  93. implementation 'io.reactivex.rxjava2:rxjava:2.0.7'
  94. //network
  95. implementation 'com.google.code.gson:gson:2.7'
  96. implementation 'com.squareup.okhttp3:okhttp:3.6.0'
  97. implementation 'com.squareup.okhttp3:logging-interceptor:3.6.0'
  98. //XRecyclerView
  99. implementation 'com.jcodecraeer:xrecyclerview:1.5.9'
  100. // implementation 'androidx.recyclerview:recyclerview:1.1.0'
  101. }