build.gradle 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. }
  25. compileOptions {
  26. sourceCompatibility JavaVersion.VERSION_1_8
  27. targetCompatibility JavaVersion.VERSION_1_8
  28. }
  29. sourceSets {
  30. main {
  31. if (!UNIAPP_MODEL) {
  32. java.srcDirs = [
  33. 'src/main/java',
  34. 'src/main/native/java'
  35. ]
  36. } else {
  37. java.srcDirs = [
  38. 'src/main/java',
  39. 'src/main/uniapp/java'
  40. ]
  41. }
  42. }
  43. }
  44. }
  45. dependencies {
  46. implementation 'androidx.appcompat:appcompat:1.3.0'
  47. implementation 'com.google.android.material:material:1.3.0'
  48. implementation 'com.google.code.gson:gson:2.9.1'
  49. // Google FCM
  50. // Import the Firebase BoM (see: https://firebase.google.com/docs/android/learn-more#bom)
  51. implementation platform('com.google.firebase:firebase-bom:31.2.3')
  52. // Firebase Cloud Messaging (Java)
  53. implementation 'com.google.firebase:firebase-messaging'
  54. // For an optimal experience using FCM, add the Firebase SDK
  55. // for Google Analytics. This is recommended, but not required.
  56. //implementation 'com.google.firebase:firebase-analytics'
  57. // xiaomi
  58. compileOnly ("com.tencent.tpns:xiaomi:1.3.7.2-release")
  59. // meizu
  60. compileOnly("com.tencent.tpns:meizu:1.3.3.3-release")
  61. // OPPO
  62. compileOnly ("com.tencent.tpns:oppo:1.3.3.3-release")
  63. compileOnly ('commons-codec:commons-codec:1.15')
  64. // vivo
  65. compileOnly ("com.tencent.tpns:vivo:1.3.3.3-release")
  66. // huawei
  67. compileOnly ('com.tencent.tpns:huawei:1.3.7.2-release')
  68. compileOnly ('com.huawei.hms:push:6.10.0.300')
  69. // honor
  70. compileOnly ('com.tencent.tpns:honor:1.3.3.3-release')
  71. if (!UNIAPP_MODEL) {
  72. def projects = this.rootProject.getAllprojects().stream().map { project -> project.name }.collect()
  73. println "all TUIOfflinePush projects : {$projects}"
  74. if (projects.contains("tuicore")) {
  75. api project(':tuicore')
  76. } else {
  77. api "com.tencent.imsdk:imsdk-plus:7.3.4358"
  78. api 'com.tencent.liteav.tuikit:tuicore:1.1.24'
  79. }
  80. } else {
  81. implementation 'com.alibaba:fastjson:1.1.46.android'
  82. compileOnly fileTree(dir: 'libs', include: ['uniapp-v8-release.aar'])
  83. }
  84. }