build.gradle 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. apply plugin: 'com.android.application'
  2. def releaseTime() {
  3. return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC"))
  4. }
  5. android {
  6. compileSdkVersion 30
  7. buildToolsVersion "30.0.1"
  8. defaultConfig {
  9. applicationId "com.edufound.bytedance"
  10. minSdkVersion 14
  11. targetSdkVersion 30
  12. versionCode 1
  13. versionName "1.0"
  14. multiDexEnabled true
  15. flavorDimensions "versionCode"
  16. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  17. manifestPlaceholders = [APP_SCHEME_HOST: "com.edufound.bytedance.yuwen.prepare"]
  18. }
  19. signingConfigs {
  20. efunbox {
  21. keyAlias "edufound_key"
  22. keyPassword "edufound321"
  23. storeFile file("C:/Users/Candy/Desktop/edufound.keystore")
  24. storePassword "edufound123"
  25. }
  26. }
  27. buildTypes {
  28. release {
  29. minifyEnabled false
  30. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  31. signingConfig signingConfigs.efunbox
  32. zipAlignEnabled true
  33. applicationVariants.all { variant ->
  34. variant.outputs.each { output ->
  35. def outputFile = output.outputFileName
  36. if (outputFile != null && output.outputFileName.endsWith('.apk')) {
  37. def channel = variant.productFlavors[0].manifestPlaceholders.APP_SCHEME_HOST;
  38. def newoutputFile = "";
  39. def apptype = "";
  40. if (channel.contains("yuwen.prepare")) {
  41. newoutputFile = "\\语文预习\\"
  42. apptype = "yuwen_prepare";
  43. } else if (channel.contains("yuwen.review")) {
  44. newoutputFile = "\\语文复习\\"
  45. apptype = "yuwen_review";
  46. } else if (channel.contains("mathematics.prepare")) {
  47. newoutputFile = "\\数学预习\\"
  48. apptype = "mathematics_prepare";
  49. } else if (channel.contains("mathematics.review")) {
  50. newoutputFile = "\\数学复习\\"
  51. apptype = "mathematics_review";
  52. }
  53. def fileName = "efunbox_bytedance_v${defaultConfig.versionCode}_${releaseTime()}_${apptype}_r.apk"
  54. output.outputFileName = new File(newoutputFile, fileName)
  55. }
  56. }
  57. }
  58. }
  59. }
  60. sourceSets {
  61. main {
  62. jniLibs.srcDirs = ["libs"]
  63. }
  64. }
  65. productFlavors {
  66. // 语文预习
  67. yuwen_prepare {
  68. signingConfig signingConfigs.efunbox
  69. applicationIdSuffix ".yuwen.prepare"
  70. manifestPlaceholders = [schemeHost: "com.edufound.bytedance.yuwen.prepare",
  71. appName : "语文预习"
  72. ]
  73. }
  74. // 语文复习
  75. yuwen_review {
  76. signingConfig signingConfigs.efunbox
  77. applicationIdSuffix ".yuwen.review"
  78. manifestPlaceholders = [schemeHost: "com.edufound.bytedance.yuwen.review",
  79. appName : "语文复习"
  80. ]
  81. }
  82. // 数学预习
  83. mathematics_prepare {
  84. signingConfig signingConfigs.efunbox
  85. applicationIdSuffix ".mathematics.prepare"
  86. manifestPlaceholders = [schemeHost: "com.edufound.bytedance.mathematics.prepare",
  87. appName : "数学预习"
  88. ]
  89. }
  90. // 数学复习
  91. mathematics_review {
  92. signingConfig signingConfigs.efunbox
  93. applicationIdSuffix ".mathematics.review"
  94. manifestPlaceholders = [schemeHost: "com.edufound.bytedance.mathematics.review",
  95. appName : "数学复习"
  96. ]
  97. }
  98. }
  99. productFlavors.all {
  100. flavor ->
  101. flavor.manifestPlaceholders = [
  102. APP_SCHEME_HOST: manifestPlaceholders.schemeHost,
  103. APP_NAME : manifestPlaceholders.appName
  104. ]
  105. }
  106. }
  107. repositories {
  108. flatDir {
  109. dirs 'libs'
  110. }
  111. }
  112. dependencies {
  113. implementation fileTree(dir: "libs", include: ["*.jar"])
  114. implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  115. implementation 'androidx.core:core-ktx:1.3.1'
  116. implementation 'androidx.appcompat:appcompat:1.2.0'
  117. //okhttp3
  118. implementation 'com.squareup.okhttp3:okhttp:4.8.0'
  119. implementation 'com.squareup.okio:okio:2.7.0'
  120. //gson
  121. implementation 'com.google.code.gson:gson:2.8.6'
  122. //umeng
  123. implementation 'com.umeng.umsdk:common:9.3.0' // (必选)版本号
  124. implementation 'com.umeng.umsdk:asms:1.1.3' // asms包依赖(必选)
  125. implementation 'com.umeng.umsdk:crash:0.0.5' // native crash包依赖(必选)
  126. }