贷款超市新仓库

build.gradle 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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 9
  19. versionName "2.0.0"
  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. aiqiyi05 {
  91. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40017"]
  92. buildConfigField 'String', 'CHANNLE', '"40017"'
  93. }
  94. aiqiyi06 {
  95. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40018"]
  96. buildConfigField 'String', 'CHANNLE', '"40018"'
  97. }
  98. aiqiyi07 {
  99. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40019"]
  100. buildConfigField 'String', 'CHANNLE', '"40019"'
  101. }
  102. xiaohuazhu40025 {
  103. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40025"]
  104. buildConfigField 'String', 'CHANNLE', '"40025"'
  105. }
  106. }
  107. }
  108. def releaseTime() {
  109. return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC"))
  110. }
  111. dependencies {
  112. compile fileTree(include: ['*.jar'], dir: 'libs')
  113. androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
  114. exclude group: 'com.android.support', module: 'support-annotations'
  115. })
  116. // compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
  117. // transitive = true;
  118. // }
  119. compile(name: 'base', ext: 'aar')
  120. // compile "com.android.support:appcompat-v7:$rootProject.ext.supportVersion"
  121. // compile "com.android.support:recyclerview-v7:$rootProject.ext.supportVersi
  122. // on"
  123. // compile "com.android.support:design:$rootProject.ext.supportVersion"
  124. compile "net.qiujuer.genius:ui:$rootProject.ext.geniusVersion"
  125. compile "net.qiujuer.genius:res:$rootProject.ext.geniusVersion"
  126. compile "de.hdodenhof:circleimageview:$rootProject.ext.circleimageviewVersion"
  127. compile "com.github.bumptech.glide:glide:$rootProject.ext.glideVersion"
  128. compile "com.jakewharton:butterknife:$rootProject.ext.butterknifeVersion"
  129. annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.ext.butterknifeVersion"
  130. compile "pub.devrel:easypermissions:$rootProject.ext.easyPMVersion"
  131. // 空气面板
  132. compile "net.qiujuer.widget:airpanel:$rootProject.ext.airpanelVersion"
  133. compile project(':common')
  134. compile project(':lang')
  135. compile project(':factory')
  136. compile project(':PhotoPicker')
  137. compile 'com.liulishuo.filedownloader:library:1.6.5'
  138. compile 'org.jsoup:jsoup:1.9.2'
  139. compile 'com.lovedise:permissiongen:0.0.6'
  140. compile 'q.rorbin:badgeview:1.1.2'
  141. compile 'com.youth.banner:banner:1.4.9'
  142. compile 'com.github.addappcn:android-pickers:1.0.3'
  143. compile 'com.contrarywind:Android-PickerView:4.1.6'
  144. compile 'com.android.support.constraint:constraint-layout:1.0.2'
  145. // compile 'com.android.support:support-v4:25.+'
  146. compile 'com.scwang.smartrefresh:SmartRefreshLayout:1.0.3'
  147. compile 'com.scwang.smartrefresh:SmartRefreshHeader:1.0.3'
  148. compile 'com.github.ittianyu:BottomNavigationViewEx:1.2.1'
  149. compile 'org.greenrobot:eventbus:3.0.0'
  150. compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30'
  151. testCompile 'junit:junit:4.12'
  152. compile 'com.github.lsjwzh.RecyclerViewPager:lib:v1.1.2'
  153. compile 'com.github.mcxtzhang:SuspensionIndexBar:V1.0.0'
  154. compile 'com.squareup.retrofit2:retrofit:2.3.0'
  155. compile 'com.squareup.retrofit2:converter-gson:2.3.0'
  156. compile 'io.reactivex.rxjava2:rxjava:2.1.6'
  157. compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
  158. compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
  159. compile 'com.zhy:autolayout:1.4.5'
  160. compile 'com.xhb:xbanner:1.4.1'
  161. compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
  162. compile 'com.contrarywind:Android-PickerView:4.1.6'
  163. compile 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.4@aar'
  164. compile 'com.amap.api:location:latest.integration'
  165. compile 'me.yokeyword:indexablerecyclerview:1.3.0'
  166. compile 'com.umeng.umsdk:analytics:latest.integration'
  167. compile 'com.umeng.umsdk:common:latest.integration'
  168. compile 'com.android.support:cardview-v7:25.2.0'
  169. compile files('libs/umeng-share-wechat-simplify-6.9.3.jar')
  170. compile files('libs/MiPush_SDK_Client_3_6_9.jar')
  171. compile 'com.huawei.android.hms:push:2.6.1.301'
  172. compile 'com.huawei.android.hms:hwid:2.6.1.301'
  173. compile files('libs/vivo_pushsdk_v2.3.1.jar')
  174. compile 'com.alibaba:fastjson:1.2.54'
  175. compile 'com.alibaba:fastjson:1.1.70.android'
  176. }
  177. def product_name = "bangnidai_v" + android.defaultConfig.versionName
  178. def time = "1367"
  179. task initTimeScape << {
  180. println "first time"
  181. println "$time"
  182. def gCalendar = new GregorianCalendar()
  183. time = gCalendar.time.format("MMddHHmm")
  184. println "second time"
  185. println "$time"
  186. }
  187. task initReleaseApkProduct_name(dependsOn: ['initTimeScape']) << {
  188. //初始化release包名
  189. product_name = product_name + "_" + time + "R.apk"
  190. def outputName = "_OUT:>PRODUCT_FILENAME=" + product_name + ";_"
  191. println "$outputName"
  192. }
  193. task initDebugApkProduct_name(dependsOn: ['initTimeScape']) << { //初始化release包名
  194. product_name = product_name + "_" + time + "D.apk"
  195. def outputName = "_OUT:>PRODUCT_FILENAME=" + product_name + ";_"
  196. println "$outputName"
  197. }
  198. task release(dependsOn: ['assembleRelease', 'initReleaseApkProduct_name']) << {
  199. copy {
  200. from('build/outputs/apk') {
  201. include('**/*-release.apk')
  202. rename '(.*)-release.apk', product_name
  203. }
  204. from('build/proguard/release') {
  205. include('**/mapping.txt')
  206. rename '(.*).txt', product_name + ".map"
  207. }
  208. into('products')
  209. }
  210. }
  211. task debug(dependsOn: ['assembleDebug', 'initDebugApkProduct_name']) << {
  212. copy {
  213. from('build/outputs/apk') {
  214. include('**/*.apk')
  215. rename '(.*).apk', product_name
  216. }
  217. into('products')
  218. }
  219. }