build.gradle 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. apply plugin: 'com.android.library'
  2. apply plugin: 'com.huawei.agconnect'
  3. android {
  4. compileSdkVersion 29
  5. buildToolsVersion "29.0.3"
  6. defaultConfig {
  7. minSdkVersion 21
  8. targetSdkVersion 29
  9. versionCode 1
  10. versionName "1.0"
  11. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  12. consumerProguardFiles 'consumer-rules.pro'
  13. ndk {
  14. //选择要添加的对应 cpu 类型的 .so 库。
  15. abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a'
  16. // 还可以添加 'x86', 'x86_64', 'mips', 'mips64'
  17. }
  18. }
  19. packagingOptions {
  20. doNotStrip '*/mips/*.so'
  21. doNotStrip '*/mips64/*.so'
  22. merge 'classes.jar'
  23. merge 'res/values/values.xml'
  24. merge 'AndroidManifest.xml'
  25. merge 'R.txt'
  26. }
  27. buildTypes {
  28. debug {
  29. }
  30. release {
  31. minifyEnabled false
  32. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  33. }
  34. }
  35. sourceSets {
  36. main {
  37. jniLibs.srcDir 'libs'
  38. jni.srcDirs = [] //disable automatic ndk-build
  39. }
  40. }
  41. compileOptions {
  42. sourceCompatibility = 1.8
  43. targetCompatibility = 1.8
  44. }
  45. }
  46. dependencies {
  47. implementation fileTree(dir: 'libs', include: ['*.jar'])
  48. implementation 'androidx.appcompat:appcompat:1.0.2'
  49. testImplementation 'junit:junit:4.12'
  50. androidTestImplementation 'androidx.test.ext:junit:1.1.0'
  51. androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  52. // push kit
  53. implementation 'com.huawei.hms:push:4.0.3.301'
  54. //
  55. implementation files('libs\\MiPush_SDK_Client_3_8_5.jar')
  56. implementation files('libs\\com.heytap.msp.aar')
  57. implementation files('libs\\vivo_pushsdk-v2.9.0.0.aar')
  58. implementation 'cn.jiguang.sdk:jpush:3.9.0' // 此处以JPush 3.9.0 版本为例。
  59. implementation 'cn.jiguang.sdk:jcore:2.6.0' // 此处以JCore 2.6.0 版本为例。
  60. }