build.gradle 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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.edufound.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. ndk {
  20. abiFilters 'armeabi-v7a'
  21. }
  22. }
  23. signingConfigs {
  24. efunbox {
  25. keyAlias "edufound_key"
  26. keyPassword "edufound321"
  27. storeFile file("C:/Users/Candy/Desktop/edufound.keystore")
  28. storePassword "edufound123"
  29. }
  30. }
  31. buildTypes {
  32. release {
  33. minifyEnabled false
  34. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  35. signingConfig signingConfigs.efunbox
  36. zipAlignEnabled true
  37. applicationVariants.all { variant ->
  38. variant.outputs.each { output ->
  39. def outputFile = output.outputFileName
  40. if (outputFile != null && output.outputFileName.endsWith('.apk')) {
  41. def fileName = "efunbox_tv_v${defaultConfig.versionCode}_${releaseTime()}_${variant.productFlavors[0].manifestPlaceholders.UMENG_CHANNEL_VALUE}_r.apk"
  42. def channel = variant.productFlavors[0].manifestPlaceholders.UMENG_CHANNEL_VALUE;
  43. def newoutputFile = "";
  44. if (channel == ("2006")) {
  45. newoutputFile = "\\义方\\"
  46. }
  47. output.outputFileName = new File(newoutputFile, fileName)
  48. }
  49. }
  50. }
  51. }
  52. }
  53. sourceSets {
  54. main {
  55. jniLibs.srcDirs = ['libs']
  56. res.srcDirs = [
  57. 'src/main/res', //默认只有这一个路径
  58. 'src/fragmentRecommend' //这个就是告诉gradle在编译的时候到这个文件夹找资源文件
  59. ]
  60. }
  61. }
  62. productFlavors {
  63. //义方
  64. channel_efunbox {
  65. signingConfig signingConfigs.efunbox
  66. manifestPlaceholders = [
  67. appCode: "2006",
  68. appIcon: "@drawable/icon",
  69. ]
  70. }
  71. }
  72. productFlavors.all {
  73. flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: manifestPlaceholders.appCode, icon: manifestPlaceholders.appIcon]
  74. }
  75. compileOptions {
  76. sourceCompatibility JavaVersion.VERSION_1_8
  77. targetCompatibility JavaVersion.VERSION_1_8
  78. }
  79. }
  80. dependencies {
  81. implementation 'androidx.appcompat:appcompat:1.0.0'
  82. testImplementation 'junit:junit:4.+'
  83. androidTestImplementation 'androidx.test.ext:junit:1.1.1'
  84. androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
  85. implementation 'com.github.bumptech.glide:glide:4.12.0'
  86. annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
  87. implementation 'jp.wasabeef:glide-transformations:4.3.0'
  88. implementation('com.zhousf.lib:okhttp3:2.9.9') {
  89. exclude(module: 'support-annotations')
  90. exclude(module: 'gson')
  91. }
  92. //gson
  93. implementation 'com.google.code.gson:gson:2.8.9'
  94. //logger
  95. implementation 'com.orhanobut:logger:2.2.0'
  96. //mmkv
  97. implementation 'com.tencent:mmkv:1.2.11'
  98. implementation 'com.uber.autodispose2:autodispose:2.0.0'
  99. implementation 'com.uber.autodispose2:autodispose-android:2.0.0'
  100. implementation 'com.uber.autodispose2:autodispose-lifecycle:2.0.0'
  101. implementation 'com.uber.autodispose2:autodispose-androidx-lifecycle:2.0.0'
  102. // 友盟基础组件库(所有友盟业务SDK都依赖基础组件库)
  103. implementation 'com.umeng.umsdk:common:9.4.4'// (必选)
  104. implementation 'com.umeng.umsdk:asms:1.4.1'// asms包依赖必选
  105. //ijkplayer
  106. implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
  107. implementation "tv.danmaku.ijk.media:ijkplayer-exo:0.8.8"
  108. //JZ播放器
  109. implementation 'cn.jzvd:jiaozivideoplayer:7.7.0'
  110. //recyclerview
  111. implementation 'androidx.recyclerview:recyclerview:1.1.0'
  112. //驰声
  113. implementation 'io.github.ChivoxSupport:vox-sdk:2.2.23+2.0.8.1'
  114. //rxBind
  115. implementation 'com.jakewharton.rxbinding4:rxbinding:4.0.0'
  116. }