build.gradle 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. plugins {
  2. id 'com.android.library'
  3. }
  4. ext {
  5. // 是否要编译 uniapp 推送原生插件,默认为 false
  6. // Whether to compile uniapp and push native plugins,default is false
  7. UNIAPP_MODEL = false
  8. }
  9. android {
  10. compileSdkVersion 30
  11. buildToolsVersion "30.0.3"
  12. defaultConfig {
  13. minSdkVersion 16
  14. targetSdkVersion 30
  15. versionCode 1
  16. versionName "1.0"
  17. //buildConfigField "boolean", "UNIAPP_MODEL", String.valueOf(UNIAPP_MODEL)
  18. }
  19. buildTypes {
  20. release {
  21. minifyEnabled false
  22. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  23. }
  24. preRelease {
  25. minifyEnabled false
  26. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  27. }
  28. }
  29. compileOptions {
  30. sourceCompatibility JavaVersion.VERSION_1_8
  31. targetCompatibility JavaVersion.VERSION_1_8
  32. }
  33. sourceSets {
  34. main {
  35. if (!UNIAPP_MODEL) {
  36. java.srcDirs = [
  37. 'src/main/java',
  38. 'src/main/native/java'
  39. ]
  40. } else {
  41. java.srcDirs = [
  42. 'src/main/java',
  43. 'src/main/uniapp/java'
  44. ]
  45. }
  46. }
  47. }
  48. }
  49. dependencies {
  50. implementation 'androidx.appcompat:appcompat:1.3.0'
  51. implementation 'com.google.android.material:material:1.3.0'
  52. implementation 'com.google.code.gson:gson:2.9.1'
  53. // Google FCM
  54. // Import the Firebase BoM (see: https://firebase.google.com/docs/android/learn-more#bom)
  55. implementation platform('com.google.firebase:firebase-bom:31.2.3')
  56. // Firebase Cloud Messaging (Java)
  57. implementation 'com.google.firebase:firebase-messaging'
  58. // For an optimal experience using FCM, add the Firebase SDK
  59. // for Google Analytics. This is recommended, but not required.
  60. //implementation 'com.google.firebase:firebase-analytics'
  61. // xiaomi
  62. compileOnly ("com.tencent.timpush:xiaomi:7.7.5282")
  63. // meizu
  64. compileOnly("com.tencent.timpush:meizu:7.7.5282")
  65. // OPPO
  66. //腾讯这边暂时不是最新的oppo,先引用极光的
  67. compileOnly ("cn.jiguang.sdk.plugin:oppo:5.3.1")
  68. compileOnly files('libs/com.heytap.msp_3.4.0.aar')
  69. compileOnly ('commons-codec:commons-codec:1.15')
  70. // vivo
  71. // compileOnly ("com.tencent.timpush:vivo:7.7.5282")
  72. //腾讯这边暂时不是最新的vivo,先引用极光的
  73. compileOnly ("cn.jiguang.sdk.plugin:vivo:5.3.1")
  74. // 接入 VIVO 厂商
  75. // huawei
  76. compileOnly ('com.tencent.timpush:huawei:7.7.5282')
  77. compileOnly ('com.huawei.hms:push:6.12.0.300')
  78. // honor
  79. compileOnly ('com.tencent.timpush:honor:7.7.5282')
  80. if (!UNIAPP_MODEL) {
  81. def projects = this.rootProject.getAllprojects().stream().map { project -> project.name }.collect()
  82. println "all TUIOfflinePush projects : {$projects}"
  83. if (projects.contains("tuicore")) {
  84. api project(':tuicore')
  85. } else {
  86. api "com.tencent.imsdk:imsdk-plus:7.3.4358"
  87. api 'com.tencent.liteav.tuikit:tuicore:1.1.24'
  88. }
  89. } else {
  90. implementation 'com.alibaba:fastjson:1.1.46.android'
  91. compileOnly fileTree(dir: 'libs', include: ['uniapp-v8-release.aar'])
  92. }
  93. }