贷款超市新仓库

build.gradle 9.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. apply plugin: 'com.android.application'
  2. //apply plugin: 'io.fabric'
  3. repositories {
  4. mavenCentral()
  5. mavenLocal()
  6. flatDir {
  7. dirs 'libs'
  8. }
  9. }
  10. def bakPath = file("${buildDir}/bakApk/")
  11. android {
  12. compileSdkVersion 25
  13. buildToolsVersion "25.0.2"
  14. defaultConfig {
  15. applicationId "com.smileflowpig.money"
  16. minSdkVersion 19
  17. targetSdkVersion 28
  18. versionCode 12
  19. versionName "2.1.1"
  20. multiDexEnabled true
  21. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  22. }
  23. //签名
  24. signingConfigs {
  25. myConfig {
  26. storeFile file("bangnidai.jks") //签名文件
  27. storePassword "bangnidai123"
  28. keyAlias "bangnidai"
  29. keyPassword "bangnidai123" //签名密码
  30. }
  31. }
  32. buildTypes {
  33. release {
  34. signingConfig signingConfigs.myConfig
  35. multiDexEnabled true
  36. minifyEnabled false
  37. proguardFiles 'proguard-rules.pro'
  38. applicationVariants.all { variant ->
  39. variant.outputs.each { output ->
  40. if (output.outputFile != null && output.outputFile.name.endsWith('.apk')
  41. && 'release'.equals(variant.buildType.name)) {
  42. def apkFile = new File(
  43. output.outputFile.getParent(),
  44. "xiaohuazhu${variant.flavorName}_v${variant.versionName}_${releaseTime()}.apk")
  45. output.outputFile = apkFile
  46. }
  47. }
  48. }
  49. }
  50. debug {
  51. signingConfig signingConfigs.myConfig
  52. minifyEnabled false
  53. multiDexEnabled true
  54. proguardFiles 'proguard-rules.pro'
  55. }
  56. }
  57. productFlavors {
  58. aoppo {
  59. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "1006"]
  60. buildConfigField 'String', 'CHANNLE', '"1006"'
  61. }
  62. a360 {
  63. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "1002"]
  64. buildConfigField 'String', 'CHANNLE', '"1002"'
  65. }
  66. ayingyongbao {
  67. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "1001"]
  68. buildConfigField 'String', 'CHANNLE', '"1001"'
  69. }
  70. axiaomi {
  71. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "1004"]
  72. buildConfigField 'String', 'CHANNLE', '"1004"'
  73. }
  74. ahuawei {
  75. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "1005"]
  76. buildConfigField 'String', 'CHANNLE', '"1005"'
  77. }
  78. ameizu {
  79. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "1007"]
  80. buildConfigField 'String', 'CHANNLE', '"1007"'
  81. }
  82. avivo {
  83. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "1003"]
  84. buildConfigField 'String', 'CHANNLE', '"1003"'
  85. }
  86. search360 {
  87. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "4001"]
  88. buildConfigField 'String', 'CHANNLE', '"4001"'
  89. }
  90. smss01 {
  91. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40002"]
  92. buildConfigField 'String', 'CHANNLE', '"40002"'
  93. }
  94. smss02 {
  95. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40003"]
  96. buildConfigField 'String', 'CHANNLE', '"40003"'
  97. }
  98. smss03 {
  99. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40004"]
  100. buildConfigField 'String', 'CHANNLE', '"40004"'
  101. }
  102. smss07 {
  103. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40005"]
  104. buildConfigField 'String', 'CHANNLE', '"40005"'
  105. }
  106. smss08 {
  107. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40006"]
  108. buildConfigField 'String', 'CHANNLE', '"40006"'
  109. }
  110. smss09 {
  111. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40007"]
  112. buildConfigField 'String', 'CHANNLE', '"40007"'
  113. }
  114. smss10 {
  115. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40008"]
  116. buildConfigField 'String', 'CHANNLE', '"40008"'
  117. }
  118. smss11 {
  119. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40009"]
  120. buildConfigField 'String', 'CHANNLE', '"40009"'
  121. }
  122. smss13 {
  123. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40025"]
  124. buildConfigField 'String', 'CHANNLE', '"40025"'
  125. }
  126. }
  127. }
  128. def releaseTime() {
  129. return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC"))
  130. }
  131. dependencies {
  132. compile fileTree(include: ['*.jar'], dir: 'libs')
  133. androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
  134. exclude group: 'com.android.support', module: 'support-annotations'
  135. })
  136. // compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
  137. // transitive = true;
  138. // }
  139. compile(name: 'base', ext: 'aar')
  140. // compile "com.android.support:appcompat-v7:$rootProject.ext.supportVersion"
  141. // compile "com.android.support:recyclerview-v7:$rootProject.ext.supportVersi
  142. // on"
  143. // compile "com.android.support:design:$rootProject.ext.supportVersion"
  144. compile "net.qiujuer.genius:ui:$rootProject.ext.geniusVersion"
  145. compile "net.qiujuer.genius:res:$rootProject.ext.geniusVersion"
  146. compile "de.hdodenhof:circleimageview:$rootProject.ext.circleimageviewVersion"
  147. compile "com.github.bumptech.glide:glide:$rootProject.ext.glideVersion"
  148. compile "com.jakewharton:butterknife:$rootProject.ext.butterknifeVersion"
  149. annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.ext.butterknifeVersion"
  150. compile "pub.devrel:easypermissions:$rootProject.ext.easyPMVersion"
  151. // 空气面板
  152. compile "net.qiujuer.widget:airpanel:$rootProject.ext.airpanelVersion"
  153. compile project(':common')
  154. compile project(':lang')
  155. compile project(':factory')
  156. compile project(':PhotoPicker')
  157. compile 'com.liulishuo.filedownloader:library:1.6.5'
  158. compile 'org.jsoup:jsoup:1.9.2'
  159. compile 'com.lovedise:permissiongen:0.0.6'
  160. compile 'q.rorbin:badgeview:1.1.2'
  161. compile 'com.youth.banner:banner:1.4.9'
  162. compile 'com.github.addappcn:android-pickers:1.0.3'
  163. compile 'com.contrarywind:Android-PickerView:4.1.6'
  164. compile 'com.android.support.constraint:constraint-layout:1.0.2'
  165. // compile 'com.android.support:support-v4:25.+'
  166. compile 'com.scwang.smartrefresh:SmartRefreshLayout:1.0.3'
  167. compile 'com.scwang.smartrefresh:SmartRefreshHeader:1.0.3'
  168. compile 'com.github.ittianyu:BottomNavigationViewEx:1.2.1'
  169. compile 'org.greenrobot:eventbus:3.0.0'
  170. compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30'
  171. testCompile 'junit:junit:4.12'
  172. compile 'com.github.lsjwzh.RecyclerViewPager:lib:v1.1.2'
  173. compile 'com.github.mcxtzhang:SuspensionIndexBar:V1.0.0'
  174. compile 'com.squareup.retrofit2:retrofit:2.3.0'
  175. compile 'com.squareup.retrofit2:converter-gson:2.3.0'
  176. compile 'io.reactivex.rxjava2:rxjava:2.1.6'
  177. compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
  178. compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
  179. compile 'com.zhy:autolayout:1.4.5'
  180. compile 'com.xhb:xbanner:1.4.1'
  181. compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
  182. compile 'com.contrarywind:Android-PickerView:4.1.6'
  183. compile 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.4@aar'
  184. compile 'com.amap.api:location:latest.integration'
  185. compile 'me.yokeyword:indexablerecyclerview:1.3.0'
  186. compile 'com.umeng.umsdk:analytics:latest.integration'
  187. compile 'com.umeng.umsdk:common:latest.integration'
  188. compile 'com.android.support:cardview-v7:25.2.0'
  189. compile files('libs/umeng-share-wechat-simplify-6.9.3.jar')
  190. compile files('libs/MiPush_SDK_Client_3_6_9.jar')
  191. compile 'com.huawei.android.hms:push:2.6.1.301'
  192. compile 'com.huawei.android.hms:hwid:2.6.1.301'
  193. compile files('libs/vivo_pushsdk_v2.3.1.jar')
  194. compile 'com.alibaba:fastjson:1.2.54'
  195. compile 'com.alibaba:fastjson:1.1.70.android'
  196. compile project(':ocr_ui')
  197. }
  198. def product_name = "bangnidai_v" + android.defaultConfig.versionName
  199. def time = "1367"
  200. task initTimeScape << {
  201. println "first time"
  202. println "$time"
  203. def gCalendar = new GregorianCalendar()
  204. time = gCalendar.time.format("MMddHHmm")
  205. println "second time"
  206. println "$time"
  207. }
  208. task initReleaseApkProduct_name(dependsOn: ['initTimeScape']) << {
  209. //初始化release包名
  210. product_name = product_name + "_" + time + "R.apk"
  211. def outputName = "_OUT:>PRODUCT_FILENAME=" + product_name + ";_"
  212. println "$outputName"
  213. }
  214. task initDebugApkProduct_name(dependsOn: ['initTimeScape']) << { //初始化release包名
  215. product_name = product_name + "_" + time + "D.apk"
  216. def outputName = "_OUT:>PRODUCT_FILENAME=" + product_name + ";_"
  217. println "$outputName"
  218. }
  219. task release(dependsOn: ['assembleRelease', 'initReleaseApkProduct_name']) << {
  220. copy {
  221. from('build/outputs/apk') {
  222. include('**/*-release.apk')
  223. rename '(.*)-release.apk', product_name
  224. }
  225. from('build/proguard/release') {
  226. include('**/mapping.txt')
  227. rename '(.*).txt', product_name + ".map"
  228. }
  229. into('products')
  230. }
  231. }
  232. task debug(dependsOn: ['assembleDebug', 'initDebugApkProduct_name']) << {
  233. copy {
  234. from('build/outputs/apk') {
  235. include('**/*.apk')
  236. rename '(.*).apk', product_name
  237. }
  238. into('products')
  239. }
  240. }