build.gradle 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. plugins {
  2. id 'com.android.application'
  3. }
  4. def releaseTime() {
  5. return new Date().format("yyyyMMddhhmmss", TimeZone.getTimeZone("UTC"))
  6. }
  7. android {
  8. compileSdkVersion 30
  9. buildToolsVersion "30.0.2"
  10. defaultConfig {
  11. applicationId "com.efunbox.reader"
  12. minSdkVersion 21
  13. targetSdkVersion 30
  14. versionCode 1
  15. versionName "1.0"
  16. flavorDimensions "versionCode"
  17. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "2006"]//添加一个默认渠道号
  18. testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
  19. }
  20. signingConfigs {
  21. efunbox {
  22. keyAlias "edufound_key"
  23. keyPassword "edufound321"
  24. storeFile file("C:/Users/Candy/Desktop/edufound.keystore")
  25. storePassword "edufound123"
  26. }
  27. }
  28. buildTypes {
  29. release {
  30. minifyEnabled false
  31. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  32. signingConfig signingConfigs.efunbox
  33. zipAlignEnabled true
  34. applicationVariants.all { variant ->
  35. variant.outputs.each { output ->
  36. def outputFile = output.outputFileName
  37. if (outputFile != null && output.outputFileName.endsWith('.apk')) {
  38. def fileName = "efunbox_tv_v${defaultConfig.versionCode}_${releaseTime()}_${variant.productFlavors[0].manifestPlaceholders.UMENG_CHANNEL_VALUE}_r.apk"
  39. def channel = variant.productFlavors[0].manifestPlaceholders.UMENG_CHANNEL_VALUE;
  40. def newoutputFile = "";
  41. if (channel == ("2006")) {
  42. newoutputFile = "\\义方\\"
  43. }
  44. output.outputFileName = new File(newoutputFile, fileName)
  45. }
  46. }
  47. }
  48. }
  49. }
  50. productFlavors {
  51. //义方
  52. channel_efunbox {
  53. signingConfig signingConfigs.efunbox
  54. manifestPlaceholders = [
  55. appCode: "2006",
  56. appIcon: "@drawable/icon",
  57. ]
  58. }
  59. }
  60. productFlavors.all {
  61. flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: manifestPlaceholders.appCode, icon: manifestPlaceholders.appIcon]
  62. }
  63. compileOptions {
  64. sourceCompatibility JavaVersion.VERSION_1_8
  65. targetCompatibility JavaVersion.VERSION_1_8
  66. }
  67. }
  68. dependencies {
  69. implementation 'androidx.appcompat:appcompat:1.0.0'
  70. testImplementation 'junit:junit:4.+'
  71. androidTestImplementation 'androidx.test.ext:junit:1.1.1'
  72. androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
  73. implementation 'com.github.bumptech.glide:glide:4.12.0'
  74. annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
  75. implementation 'jp.wasabeef:glide-transformations:4.3.0'
  76. implementation('com.zhousf.lib:okhttp3:2.9.9') {
  77. exclude(module: 'support-annotations')
  78. exclude(module: 'gson')
  79. }
  80. implementation 'com.google.code.gson:gson:2.8.9'
  81. implementation 'com.orhanobut:logger:2.2.0'
  82. implementation 'com.tencent:mmkv:1.2.11'
  83. implementation 'com.uber.autodispose2:autodispose:2.0.0'
  84. implementation 'com.uber.autodispose2:autodispose-android:2.0.0'
  85. implementation 'com.uber.autodispose2:autodispose-lifecycle:2.0.0'
  86. implementation 'com.uber.autodispose2:autodispose-androidx-lifecycle:2.0.0'
  87. // 友盟基础组件库(所有友盟业务SDK都依赖基础组件库)
  88. implementation 'com.umeng.umsdk:common:9.4.4'// (必选)
  89. implementation 'com.umeng.umsdk:asms:1.4.1'// asms包依赖必选
  90. }