build.gradle 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. if (!isNeedMainModule.toBoolean()) {
  2. apply plugin: 'com.android.application'
  3. } else {
  4. apply plugin: 'com.android.library'
  5. }
  6. apply plugin: 'kotlin-android'
  7. apply plugin: 'kotlin-android-extensions'
  8. apply plugin: 'kotlin-kapt'
  9. apply from: "../gradle_component/baseconfig.gradle"
  10. apply plugin: 'com.google.gms.google-services'
  11. static def releaseTime() {
  12. return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC"))
  13. }
  14. android {
  15. defaultConfig {
  16. if (!isNeedMainModule.toBoolean()) {
  17. applicationId "com.sinata.feixin"
  18. }
  19. // javaCompileOptions {
  20. // annotationProcessorOptions {
  21. // arguments = [moduleName: project.getName()]
  22. // }
  23. // }
  24. kapt {
  25. arguments {
  26. arg("AROUTER_MODULE_NAME", project.getName())
  27. }
  28. }
  29. }
  30. buildTypes {
  31. release {
  32. if (!isNeedMainModule.toBoolean()) {
  33. //修改生成的apk名字
  34. applicationVariants.all { variant ->
  35. // 更新至Android Studio 3.3 gradle 4.10.1
  36. variant.outputs.all {
  37. outputFileName = "飞信${rootProject.ext.versionName}(${rootProject.ext.versionCode})_${(releaseTime())}.apk"
  38. }
  39. // variant.outputs.each { output ->
  40. // def outputFile = output.outputFile
  41. // if (outputFile != null && outputFile.name.endsWith('.apk') && variant.buildType.name.equals("release")) {
  42. // def fileName = "bc_chat${rootProject.ext.versionName}(${rootProject.ext.versionCode})_${(releaseTime())}.apk"
  43. // output.outputFileName = new File(fileName)
  44. // }
  45. // }
  46. }
  47. }
  48. }
  49. }
  50. }
  51. dependencies {
  52. implementation fileTree(dir: 'libs', include: ['*.jar'])
  53. testImplementation 'junit:junit:4.12'
  54. androidTestImplementation 'com.android.support.test:runner:1.0.2'
  55. androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
  56. if (isNeedAccoutModule.toBoolean()) {
  57. implementation project(':bc_account')
  58. }
  59. if (isNeedImModule.toBoolean()) {
  60. implementation project(':bc_im')
  61. }
  62. if (isNeedMineModule.toBoolean()) {
  63. implementation project(':bc_mine')
  64. }
  65. if (isNeedContactModule.toBoolean()) {
  66. implementation project(':bc_contacts')
  67. }
  68. kapt "com.alibaba:arouter-compiler:1.2.2"
  69. // 靠谱点的圆形视图库
  70. implementation 'com.makeramen:roundedimageview:2.3.0'
  71. // api 'com.google.firebase:firebase-core:17.2.0'
  72. // api 'com.google.firebase:firebase-messaging:20.0.0'
  73. // api 'com.google.android.gms:play-services:12.0.1'
  74. implementation("com.google.android.gms:play-services-gcm:12.0.1") {
  75. force = true
  76. }
  77. api 'com.google.firebase:firebase-messaging:17.6.0'
  78. }