贷款超市新仓库

build.gradle 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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.xjxeqb.money"
  16. minSdkVersion 19
  17. targetSdkVersion 25
  18. versionCode 1
  19. versionName "1.0.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. "BNDXJD${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. z30033{
  59. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "30001"]
  60. buildConfigField 'String','CHANNLE','"30001"'
  61. }
  62. aoppo{
  63. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "30053"]
  64. buildConfigField 'String','CHANNLE','"30053"'
  65. }
  66. a360{
  67. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "30050"]
  68. buildConfigField 'String','CHANNLE','"30050"'
  69. }
  70. ayingyongbao{
  71. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "30051"]
  72. buildConfigField 'String','CHANNLE','"30051"'
  73. }
  74. axiaomi{
  75. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "30055"]
  76. buildConfigField 'String','CHANNLE','"30055"'
  77. }
  78. ahuawei{
  79. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "30054"]
  80. buildConfigField 'String','CHANNLE','"30054"'
  81. }
  82. abaidu{
  83. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "30056"]
  84. buildConfigField 'String','CHANNLE','"30056"'
  85. }
  86. avivo{
  87. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "30052"]
  88. buildConfigField 'String','CHANNLE','"30052"'
  89. }
  90. bvivo{
  91. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "30057"]
  92. buildConfigField 'String','CHANNLE','"30057"'
  93. }
  94. bxiaomi{
  95. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "30058"]
  96. buildConfigField 'String','CHANNLE','"30058"'
  97. }
  98. byingyongbao{
  99. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "30059"]
  100. buildConfigField 'String','CHANNLE','"30059"'
  101. }
  102. bhuawei{
  103. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "30060"]
  104. buildConfigField 'String','CHANNLE','"30060"'
  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.supportVersion"
  122. // compile "com.android.support:design:$rootProject.ext.supportVersion"
  123. compile "net.qiujuer.genius:ui:$rootProject.ext.geniusVersion"
  124. compile "net.qiujuer.genius:res:$rootProject.ext.geniusVersion"
  125. compile "de.hdodenhof:circleimageview:$rootProject.ext.circleimageviewVersion"
  126. compile "com.github.bumptech.glide:glide:$rootProject.ext.glideVersion"
  127. compile "com.jakewharton:butterknife:$rootProject.ext.butterknifeVersion"
  128. annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.ext.butterknifeVersion"
  129. compile "pub.devrel:easypermissions:$rootProject.ext.easyPMVersion"
  130. // 空气面板
  131. compile "net.qiujuer.widget:airpanel:$rootProject.ext.airpanelVersion"
  132. compile project(':common')
  133. compile project(':lang')
  134. compile project(':factory')
  135. compile files('libs/MiPush_SDK_Client_3_2_2.jar')
  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.android.support.constraint:constraint-layout:1.0.2'
  144. // compile 'com.android.support:support-v4:25.+'
  145. compile 'com.scwang.smartrefresh:SmartRefreshLayout:1.0.3'
  146. compile 'com.scwang.smartrefresh:SmartRefreshHeader:1.0.3'
  147. compile 'com.github.ittianyu:BottomNavigationViewEx:1.2.1'
  148. compile 'org.greenrobot:eventbus:3.0.0'
  149. compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30'
  150. testCompile 'junit:junit:4.12'
  151. compile 'com.github.lsjwzh.RecyclerViewPager:lib:v1.1.2'
  152. compile 'com.github.mcxtzhang:SuspensionIndexBar:V1.0.0'
  153. }
  154. def product_name = "bangnidai_v" + android.defaultConfig.versionName
  155. def time = "1367"
  156. task initTimeScape << {
  157. println "first time"
  158. println "$time"
  159. def gCalendar = new GregorianCalendar()
  160. time = gCalendar.time.format("MMddHHmm")
  161. println "second time"
  162. println "$time"
  163. }
  164. task initReleaseApkProduct_name(dependsOn: ['initTimeScape']) << {
  165. //初始化release包名
  166. product_name = product_name + "_" + time + "R.apk"
  167. def outputName = "_OUT:>PRODUCT_FILENAME=" + product_name + ";_"
  168. println "$outputName"
  169. }
  170. task initDebugApkProduct_name(dependsOn: ['initTimeScape']) << { //初始化release包名
  171. product_name = product_name + "_" + time + "D.apk"
  172. def outputName = "_OUT:>PRODUCT_FILENAME=" + product_name + ";_"
  173. println "$outputName"
  174. }
  175. task release(dependsOn: ['assembleRelease', 'initReleaseApkProduct_name']) << {
  176. copy {
  177. from('build/outputs/apk') {
  178. include('**/*-release.apk')
  179. rename '(.*)-release.apk', product_name
  180. }
  181. from('build/proguard/release') {
  182. include('**/mapping.txt')
  183. rename '(.*).txt', product_name + ".map"
  184. }
  185. into('products')
  186. }
  187. }
  188. task debug(dependsOn: ['assembleDebug', 'initDebugApkProduct_name']) << {
  189. copy {
  190. from('build/outputs/apk') {
  191. include('**/*.apk')
  192. rename '(.*).apk', product_name
  193. }
  194. into('products')
  195. }
  196. }