build.gradle 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. plugins {
  2. id 'com.android.library'
  3. id 'kotlin-android'
  4. id 'com.kezong.fat-aar'
  5. }
  6. android {
  7. namespace 'vinno.sportinspect.sdk'
  8. compileSdkVersion 33
  9. defaultConfig {
  10. minSdkVersion 21
  11. targetSdkVersion 33
  12. versionCode 100
  13. versionName "1.0.0"
  14. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  15. ndk {
  16. //选择要添加的对应cpu类型的.so库。
  17. //moduleName "serial_port"
  18. // abiFilters 'armeabi-v7a','arm64-v8a'
  19. abiFilters 'armeabi", "armeabi-v7a", "arm64-v8a'
  20. // 还可以添加 'x86', 'x86_64', 'mips', 'mips64'
  21. }
  22. }
  23. repositories {
  24. flatDir {
  25. dirs 'libs'
  26. }
  27. }
  28. sourceSets {
  29. main {
  30. jni.srcDirs = []
  31. jniLibs.srcDirs = ['src/main/jniLibs']
  32. }
  33. }
  34. buildTypes {
  35. release {
  36. minifyEnabled false
  37. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  38. debuggable true
  39. }
  40. // debug {
  41. // //混淆
  42. // minifyEnabled false
  43. // //加载默认的混淆配置文件
  44. // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  45. // }
  46. }
  47. compileOptions {
  48. sourceCompatibility JavaVersion.VERSION_1_8
  49. targetCompatibility JavaVersion.VERSION_1_8
  50. }
  51. buildFeatures {
  52. viewBinding true
  53. }
  54. splits {
  55. // 基于不同的abi架构配置不同的apk
  56. abi {
  57. // 必须为true,打包才会为不同的abi生成不同的apk
  58. enable false
  59. // 默认情况下,包含了所有的ABI。
  60. // 所以使用reset()清空所有的ABI,再使用include指定我们想要生成的架构armeabi-v7a、arm-v8a
  61. reset()
  62. // 逗号分隔列表的形式指定 Gradle 应针对哪些 ABI 生成 APK。只与 reset() 结合使用,以指定确切的 ABI 列表。
  63. //include "armeabi-v7a", "arm64-v8a"
  64. include 'armeabi', 'armeabi-v7a', 'arm64-v8a'
  65. // 是否生成通用的apk,也就是包含所有ABI的apk。如果设为 true,那么除了按 ABI 生成的 APK 之外,Gradle 还会生成一个通用 APK。
  66. universalApk true
  67. }
  68. }
  69. ndkVersion '20.0.5594570'
  70. }
  71. dependencies {
  72. implementation fileTree(dir: 'libs', include: ['*.jar'])
  73. implementation(name: 'ecgsdk_library', ext: 'aar')
  74. // implementation(name: 'empble', ext: 'aar')
  75. // implementation fileTree(dir: 'libs', include: ['*.aar'])
  76. //noinspection GradleCompatible
  77. implementation 'com.android.support:gridlayout-v7:25.+'
  78. implementation 'androidx.appcompat:appcompat:1.4.1'
  79. implementation 'com.google.android.material:material:1.6.0'
  80. implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  81. implementation 'org.greenrobot:eventbus:3.1.1'
  82. implementation project(path: ':vivachek_protocol_lib')
  83. implementation files('libs\\dom4j-1.6.1.jar')
  84. testImplementation 'junit:junit:4.13.2'
  85. androidTestImplementation 'androidx.test.ext:junit:1.1.3'
  86. androidTestImplementation 'androidx.test:core:1.4.1-alpha03'
  87. androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
  88. androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
  89. androidTestImplementation 'androidx.test:runner:1.4.1-alpha03'
  90. androidTestImplementation 'org.hamcrest:hamcrest-integration:1.3'//断言工具
  91. implementation "androidx.core:core-ktx:1.7.0"
  92. implementation 'androidx.fragment:fragment:1.4.0-alpha04'
  93. implementation 'androidx.activity:activity:1.3.1'
  94. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  95. //打包aar用
  96. embed ('org.apache.commons:commons-lang3:3.7')
  97. embed ('com.google.code.gson:gson:2.8.9')
  98. // Log
  99. embed('com.orhanobut:logger:2.2.0')
  100. //embed('com.github.Jasonchenlijian:FastBle:2.4.0')
  101. //调用用
  102. implementation ('org.apache.commons:commons-lang3:3.7')
  103. implementation ('com.google.code.gson:gson:2.8.9')
  104. // Log
  105. implementation('com.orhanobut:logger:2.2.0')
  106. //implementation('com.github.Jasonchenlijian:FastBle:2.4.0')
  107. }