build.gradle 5.4 KB

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