build.gradle 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. //****************************************
  2. //************ app 壳的配置文件 ************
  3. //****************************************
  4. //apply plugin: 'com.android.application'
  5. //apply plugin: 'kotlin-android'
  6. //apply plugin: 'com.alibaba.arouter'
  7. //apply plugin: 'kotlin-android-extensions'
  8. //apply plugin: 'kotlin-kapt'
  9. //apply plugin: 'com.google.gms.google-services'
  10. //apply plugin: 'com.google.firebase.crashlytics'
  11. plugins {
  12. id 'com.android.application'
  13. id 'kotlin-android'
  14. id 'com.alibaba.arouter'
  15. id 'kotlin-android-extensions'
  16. id 'kotlin-kapt'
  17. }
  18. import com.yc.buildsrc.*
  19. android {
  20. compileSdkVersion ProjectBuildConfig.compileSdkVersion
  21. buildToolsVersion ProjectBuildConfig.buildToolsVersion
  22. defaultConfig {
  23. applicationId ProjectBuildConfig.applicationId
  24. minSdkVersion ProjectBuildConfig.minSdkVersion
  25. targetSdkVersion ProjectBuildConfig.targetSdkVersion
  26. versionCode ProjectBuildConfig.versionCode
  27. versionName ProjectBuildConfig.versionName
  28. testInstrumentationRunner DependencyConfig.AndroidX.AndroidJUnitRunner
  29. multiDexEnabled true
  30. flavorDimensions "versionCode"
  31. manifestPlaceholders = [qqappid: ProjectBuildConfig.applicationId]
  32. ndk {
  33. // 设置支持的SO库架构
  34. abiFilters 'armeabi-v7a', 'arm64-v8a'
  35. // abiFilters 'armeabi-v7a',"arm64-v8a" ,'x86_64','x86'
  36. }
  37. }
  38. signingConfigs {
  39. release {
  40. storeFile file('../keystores/myimsdk.jks')
  41. keyAlias "myimsdk"
  42. storePassword "123456"
  43. keyPassword "123456"
  44. v1SigningEnabled true
  45. v2SigningEnabled true
  46. }
  47. debug {
  48. storeFile file("../keystores/myimsdk.jks")
  49. keyAlias "myimsdk"
  50. storePassword "123456"
  51. keyPassword "123456"
  52. v1SigningEnabled true
  53. v2SigningEnabled true
  54. }
  55. }
  56. productFlavors {
  57. office {}
  58. vivo {}
  59. huawei {}
  60. oppo {}
  61. huawei {}
  62. xiaomi {}
  63. wandoujia {}
  64. yingyongbao {}
  65. tianka360 {}
  66. }
  67. productFlavors.all {
  68. //遍历替换所有渠道
  69. flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]
  70. }
  71. // 自定义打包apk的文件名
  72. android.applicationVariants.all { variant ->
  73. variant.outputs.all { output ->
  74. if (outputFileName != null && outputFileName.endsWith('.apk')) {
  75. outputFileName = "tianka" +
  76. "_${ProjectBuildConfig.versionCode}" +
  77. "_${ProjectBuildConfig.versionName}" +
  78. "_${variant.buildType.name}" +
  79. "_${variant.productFlavors[0].name}"+
  80. ".apk"
  81. }
  82. }
  83. }
  84. buildTypes {
  85. // // 对应 ALPHA 版本
  86. debug {
  87. buildConfigField "String", "VERSION_TYPE", "\"${ProjectBuildConfig.Version.ALPHA}\""
  88. signingConfig signingConfigs.release
  89. minifyEnabled false
  90. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  91. }
  92. beta {
  93. buildConfigField "String", "VERSION_TYPE", "\"${ProjectBuildConfig.Version.BETA}\""
  94. // signingConfig signingConfigs.releaseConfig
  95. minifyEnabled false
  96. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  97. }
  98. release {
  99. buildConfigField "String", "VERSION_TYPE", "\"${ProjectBuildConfig.Version.RELEASE}\""
  100. signingConfig signingConfigs.release
  101. minifyEnabled true
  102. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  103. }
  104. }
  105. compileOptions {
  106. sourceCompatibility JavaVersion.VERSION_1_8
  107. targetCompatibility JavaVersion.VERSION_1_8
  108. }
  109. lintOptions {
  110. checkReleaseBuilds false
  111. abortOnError false
  112. }
  113. kotlinOptions {
  114. jvmTarget = '1.8'
  115. }
  116. packagingOptions {
  117. exclude 'META-INF/DEPENDENCIES'
  118. exclude 'META-INF/NOTICE'
  119. exclude 'META-INF/LICENSE'
  120. exclude 'META-INF/LICENSE.txt'
  121. exclude 'META-INF/NOTICE.txt'
  122. }
  123. }
  124. repositories {
  125. flatDir {
  126. dirs 'libs', '../libs'
  127. }
  128. }
  129. dependencies {
  130. implementation fileTree(dir: "libs", include: ["*.jar"])
  131. // if (!ProjectBuildConfig.isAppMode) {
  132. //
  133. // } else {
  134. implementation project(":module_base")
  135. implementation project(':module_main')
  136. implementation project(':module_home')
  137. implementation project(':module_me')
  138. implementation project(':module_message')
  139. implementation project(':module_live')
  140. implementation project(':module_find')
  141. implementation project(':module_follow')
  142. // implementation 'com.meituan.android.walle:library:1.1.6'
  143. // }
  144. // implementation platform('com.google.firebase:firebase-bom:28.1.0')
  145. // implementation 'com.google.firebase:firebase-crashlytics-ktx'
  146. // implementation("com.google.firebase:firebase-analytics-ktx")
  147. kapt DependencyConfig.GitHub.AutoServiceAnnotations
  148. // implementation "io.github.didi.dokit:dokitx:3.5.0.1"
  149. // implementation 'com.squareup.leakcanary:leakcanary-android:1.6.1'
  150. // compile 'com.github.dreamlivemeng:Clog:1.0.2'
  151. // releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.1'
  152. }