统一IM方案,Android端sdk
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
3.7KB

  1. plugins {
  2. id 'com.android.library'
  3. id 'org.jetbrains.kotlin.android'
  4. id 'maven-publish'
  5. id 'kotlin-kapt'
  6. }
  7. def versionCode = 1
  8. def versionName = "0.0.1.011"
  9. android {
  10. namespace 'cn.org.bjca.trust.push'
  11. compileSdk 33
  12. defaultConfig {
  13. minSdk 24
  14. targetSdk 33
  15. buildConfigField("int", "versionCode", "${versionCode}")
  16. buildConfigField("String", "versionName", "\"${versionName}\"")
  17. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  18. consumerProguardFiles "consumer-rules.pro"
  19. }
  20. buildTypes {
  21. debug {
  22. // 开启混淆
  23. minifyEnabled true
  24. // Zipalign压缩优化
  25. zipAlignEnabled true
  26. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  27. }
  28. release {
  29. // 开启混淆
  30. minifyEnabled true
  31. // Zipalign压缩优化
  32. zipAlignEnabled true
  33. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  34. }
  35. }
  36. compileOptions {
  37. sourceCompatibility JavaVersion.VERSION_11
  38. targetCompatibility JavaVersion.VERSION_11
  39. }
  40. kotlinOptions {
  41. jvmTarget = '11'
  42. }
  43. publishing {
  44. multipleVariants {
  45. withSourcesJar()
  46. withJavadocJar()
  47. allVariants()
  48. }
  49. }
  50. }
  51. dependencies {
  52. compileOnly fileTree(dir: 'libs',includes: ['*.jar','*.aar'])
  53. implementation 'androidx.core:core-ktx:1.7.0'
  54. implementation 'androidx.appcompat:appcompat:1.4.1'
  55. implementation 'com.google.android.material:material:1.5.0'
  56. testImplementation 'junit:junit:4.13.2'
  57. androidTestImplementation 'androidx.test.ext:junit:1.1.3'
  58. androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
  59. //数据库相关
  60. implementation("androidx.room:room-runtime:2.5.0")
  61. kapt("androidx.room:room-compiler:2.5.0")
  62. // implementation("androidx.room:room-ktx:2.5.0")
  63. //添加mqtt 2个包
  64. implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5'
  65. implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
  66. //gson
  67. implementation 'com.google.code.gson:gson:2.9.0'
  68. // 小米推送
  69. // implementation (name: 'MiPush_SDK_Client_5_3_0-C_3rd', ext: 'aar')
  70. // 华为推送
  71. implementation 'com.huawei.hms:push:6.9.0.300'
  72. }
  73. // 这个是把源码打入aar包中的任务
  74. task sourceJar(type: Jar) {
  75. archiveClassifier.set('sources')
  76. from android.sourceSets.main.java.srcDirs
  77. }
  78. /**
  79. * 上传aar到仓库
  80. */
  81. afterEvaluate {
  82. publishing {
  83. publications {
  84. release(MavenPublication) {
  85. groupId = 'cn.org.bjca.trus'
  86. artifactId = 'push'
  87. version = versionName
  88. // 这里除了有debug 还有release
  89. from components.release
  90. // 运行任务,把源码打进去
  91. // artifact sourceJar
  92. }
  93. }
  94. // 添加仓库地址
  95. repositories {
  96. maven {
  97. allowInsecureProtocol(true)
  98. name = "xuqm"
  99. url = mavenXuqm.mavenUrl
  100. credentials {
  101. username(mavenXuqm.username)
  102. password(mavenXuqm.password)
  103. }
  104. }
  105. maven {
  106. allowInsecureProtocol(true)
  107. name = "szyx"
  108. url = mavenSzyx.mavenUrl
  109. credentials {
  110. username(mavenSzyx.username)
  111. password(mavenSzyx.password)
  112. }
  113. }
  114. }
  115. }
  116. }