build.gradle 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. plugins {
  2. id 'com.android.application'
  3. }
  4. def releaseTime() {
  5. return new Date().format("yyyyMMddHHmmss", TimeZone.getTimeZone("CTT"))
  6. }
  7. android {
  8. compileSdk 34
  9. defaultConfig {
  10. applicationId "com.edufound.model"
  11. minSdk 21
  12. //noinspection ExpiredTargetSdkVersion
  13. targetSdk 34
  14. versionCode 40
  15. versionName "4.0"
  16. testInstrumentationRunner
  17. flavorDimensions "versionCode"
  18. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "2006"]//添加一个默认渠道号
  19. multiDexEnabled true
  20. ndk {
  21. abiFilters "arm64-v8a"
  22. abiFilters "armeabi-v7a"
  23. abiFilters "armeabi"
  24. abiFilters "x86"
  25. // 添加x86必须添加x86_64
  26. abiFilters "x86_64"
  27. }
  28. }
  29. signingConfigs {
  30. efunboxKey {
  31. keyAlias "edufound_key"
  32. keyPassword "edufound321"
  33. storeFile file("C:/Users/candy/Desktop/efunbox/edufound.keystore")
  34. storePassword "edufound123"
  35. v1SigningEnabled true
  36. v2SigningEnabled true
  37. }
  38. }
  39. buildTypes {
  40. release {
  41. minifyEnabled false
  42. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  43. signingConfig signingConfigs.efunboxKey
  44. applicationVariants.all { variant ->
  45. variant.outputs.each { output ->
  46. def outputFile = output.outputFileName
  47. if (outputFile != null && output.outputFileName.endsWith('.apk')) {
  48. def channel = variant.productFlavors[0].manifestPlaceholders.UMENG_CHANNEL_VALUE;
  49. def fileName = "edufound_xyyf_v${defaultConfig.versionCode}_${releaseTime()}_${channel}_${defaultConfig.minSdk}_${buildType.name}.apk"
  50. def newoutputFile = "";
  51. if (channel == ("0000")) {
  52. newoutputFile = "义方渠道TV"
  53. }
  54. newoutputFile = newoutputFile + "${channel}"
  55. output.outputFileName = new File(newoutputFile, fileName)
  56. }
  57. }
  58. }
  59. }
  60. debug {
  61. minifyEnabled false
  62. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  63. signingConfig signingConfigs.efunboxKey
  64. zipAlignEnabled true
  65. }
  66. }
  67. compileOptions {
  68. sourceCompatibility JavaVersion.VERSION_1_8
  69. targetCompatibility JavaVersion.VERSION_1_8
  70. }
  71. buildFeatures {
  72. viewBinding true
  73. }
  74. sourceSets {
  75. main {
  76. jniLibs.srcDirs = ['libs']
  77. res.srcDirs = [
  78. 'src/main/res', //默认只有这一个路径
  79. ]
  80. }
  81. }
  82. productFlavors {
  83. //义方
  84. channel_efunbox {
  85. signingConfig signingConfigs.efunboxKey
  86. manifestPlaceholders = [
  87. appCode : "0000",
  88. umengKey : "",
  89. roundIcon: "@mipmap/ic_launcher_round",
  90. appIcon : "@mipmap/ic_launcher",
  91. banner : "@mipmap/ic_launcher",
  92. appName : "学有义方"
  93. ]
  94. ndk {
  95. abiFilters "armeabi-v7a"
  96. abiFilters "arm64-v8a"
  97. abiFilters "armeabi"
  98. abiFilters "x86"
  99. // 添加x86必须添加x86_64
  100. abiFilters "x86_64"
  101. }
  102. }
  103. //义方文化 移动端
  104. mobile_channel_efunbox {
  105. applicationId "com.edufound.android.xyyf"
  106. manifestPlaceholders = [
  107. appCode : "0000",
  108. umengKey : "",
  109. roundIcon: "@mipmap/ic_launcher_round",
  110. appIcon : "@mipmap/ic_launcher",
  111. banner : "@mipmap/ic_launcher",
  112. appName : "学有义方"
  113. ]
  114. ndk {
  115. abiFilters "armeabi-v7a"
  116. abiFilters "arm64-v8a"
  117. abiFilters "armeabi"
  118. abiFilters "x86"
  119. // 添加x86必须添加x86_64
  120. abiFilters "x86_64"
  121. }
  122. }
  123. }
  124. productFlavors.all {
  125. flavor ->
  126. flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: manifestPlaceholders.appCode,
  127. UMENG_CHANNEL_KEY : manifestPlaceholders.umengKey,
  128. roundIcon : manifestPlaceholders.roundIcon,
  129. icon : manifestPlaceholders.appIcon,
  130. banner : manifestPlaceholders.banner,
  131. APP_NAME : manifestPlaceholders.appName]
  132. }
  133. compileOptions {
  134. sourceCompatibility JavaVersion.VERSION_1_8
  135. targetCompatibility JavaVersion.VERSION_1_8
  136. }
  137. }
  138. dependencies {
  139. api userLibs.get('appcompat')
  140. api userLibs.get('material')
  141. api userLibs.get('constraintlayout')
  142. api userLibs.get('gson')
  143. api userLibs.get('recyclerview')
  144. testImplementation testLibs.get('junit')
  145. androidTestImplementation testLibs.get('junitAndroid')
  146. androidTestImplementation testLibs.get('espresso')
  147. if (isRelease) {
  148. api project(':app-pay')
  149. api project(':app-video')
  150. }
  151. api project(':app-base')
  152. }