build.gradle 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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.tpns:xiaomi:1.3.7.2-release")
  63. // meizu
  64. compileOnly("com.tencent.tpns:meizu:1.3.3.3-release")
  65. // OPPO
  66. compileOnly ("com.tencent.tpns:oppo:1.3.3.3-release")
  67. compileOnly ('commons-codec:commons-codec:1.15')
  68. // vivo
  69. compileOnly ("com.tencent.tpns:vivo:1.3.3.3-release")
  70. // huawei
  71. compileOnly ('com.tencent.tpns:huawei:1.3.7.2-release')
  72. compileOnly ('com.huawei.hms:push:6.10.0.300')
  73. // honor
  74. compileOnly ('com.tencent.tpns:honor:1.3.3.3-release')
  75. if (!UNIAPP_MODEL) {
  76. def projects = this.rootProject.getAllprojects().stream().map { project -> project.name }.collect()
  77. println "all TUIOfflinePush projects : {$projects}"
  78. if (projects.contains("tuicore")) {
  79. api project(':tuicore')
  80. } else {
  81. api "com.tencent.imsdk:imsdk-plus:7.3.4358"
  82. api 'com.tencent.liteav.tuikit:tuicore:1.1.24'
  83. }
  84. } else {
  85. implementation 'com.alibaba:fastjson:1.1.46.android'
  86. compileOnly fileTree(dir: 'libs', include: ['uniapp-v8-release.aar'])
  87. }
  88. }