统一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.

151 lines
4.3KB

  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. multiDexEnabled true
  20. }
  21. buildTypes {
  22. debug {
  23. // 开启混淆
  24. minifyEnabled false
  25. // Zipalign压缩优化
  26. zipAlignEnabled true
  27. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  28. }
  29. release {
  30. // 开启混淆
  31. minifyEnabled true
  32. // Zipalign压缩优化
  33. zipAlignEnabled true
  34. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  35. }
  36. }
  37. compileOptions {
  38. sourceCompatibility JavaVersion.VERSION_11
  39. targetCompatibility JavaVersion.VERSION_11
  40. }
  41. kotlinOptions {
  42. jvmTarget = '11'
  43. }
  44. publishing {
  45. multipleVariants {
  46. withSourcesJar()
  47. withJavadocJar()
  48. allVariants()
  49. }
  50. }
  51. }
  52. dependencies {
  53. compileOnly fileTree(dir: 'libs',includes: ['*.jar','*.aar'])
  54. implementation 'androidx.core:core-ktx:1.7.0'
  55. implementation 'androidx.appcompat:appcompat:1.4.1'
  56. implementation 'com.google.android.material:material:1.5.0'
  57. testImplementation 'junit:junit:4.13.2'
  58. androidTestImplementation 'androidx.test.ext:junit:1.1.3'
  59. androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
  60. //数据库相关
  61. implementation("androidx.room:room-runtime:2.5.0")
  62. kapt("androidx.room:room-compiler:2.5.0")
  63. // implementation("androidx.room:room-ktx:2.5.0")
  64. //添加mqtt 2个包
  65. implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5'
  66. implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
  67. //网络请求
  68. implementation 'com.squareup.retrofit2:retrofit:2.9.0'
  69. implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
  70. api 'com.squareup.okhttp3:logging-interceptor:4.9.1'
  71. implementation 'com.github.franmontiel:PersistentCookieJar:v1.0.1'
  72. //Dagger
  73. implementation 'com.google.dagger:hilt-android:2.40.5'
  74. kapt 'com.google.dagger:hilt-android-compiler:2.40.5'
  75. //Coroutine
  76. api "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
  77. api "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"
  78. api "androidx.lifecycle:lifecycle-runtime-ktx:2.5.0-alpha05"
  79. //gson
  80. api 'com.google.code.gson:gson:2.9.0'
  81. // 小米推送
  82. // implementation (name: 'MiPush_SDK_Client_5_3_0-C_3rd', ext: 'aar')
  83. // 华为推送
  84. implementation 'com.huawei.hms:push:6.9.0.300'
  85. }
  86. // 这个是把源码打入aar包中的任务
  87. task sourceJar(type: Jar) {
  88. archiveClassifier.set('sources')
  89. from android.sourceSets.main.java.srcDirs
  90. }
  91. /**
  92. * 上传aar到仓库
  93. */
  94. afterEvaluate {
  95. publishing {
  96. publications {
  97. release(MavenPublication) {
  98. groupId = 'cn.org.bjca.trus'
  99. artifactId = 'push'
  100. version = versionName
  101. // 这里除了有debug 还有release
  102. from components.release
  103. // 运行任务,把源码打进去
  104. // artifact sourceJar
  105. }
  106. }
  107. // 添加仓库地址
  108. repositories {
  109. maven {
  110. allowInsecureProtocol(true)
  111. name = "xuqm"
  112. url = mavenXuqm.mavenUrl
  113. credentials {
  114. username(mavenXuqm.username)
  115. password(mavenXuqm.password)
  116. }
  117. }
  118. maven {
  119. allowInsecureProtocol(true)
  120. name = "szyx"
  121. url = mavenSzyx.mavenUrl
  122. credentials {
  123. username(mavenSzyx.username)
  124. password(mavenSzyx.password)
  125. }
  126. }
  127. }
  128. }
  129. }