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.

build.gradle 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'com.jakewharton.butterknife'
  3. android {
  4. compileSdkVersion 31
  5. defaultConfig {
  6. applicationId "aicare.net.cn.sdk.ailinksdkdemoandroid"
  7. minSdkVersion 19
  8. targetSdkVersion 31
  9. versionName "1.11.10"
  10. versionCode getVersionCodeNumber(versionName)
  11. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  12. }
  13. buildTypes {
  14. release {
  15. minifyEnabled false
  16. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  17. }
  18. }
  19. compileOptions {
  20. sourceCompatibility '1.8'
  21. targetCompatibility '1.8'
  22. }
  23. repositories {
  24. flatDir {
  25. dirs 'libs'
  26. }
  27. }
  28. sourceSets {
  29. main {
  30. jniLibs.srcDirs = ['libs']
  31. }
  32. }
  33. }
  34. static def getVersionCodeNumber(String versionName) {
  35. //1.49.13_beta05
  36. int code=0
  37. if (versionName!=null){
  38. String versionCodeStr=versionName+"80"
  39. if (versionName.contains("_")){
  40. String[] versionStr=versionName.split("_")
  41. versionCodeStr=versionStr[0]+"."+versionStr[1].substring(4)
  42. }
  43. String[] versionCodes=versionCodeStr.split("\\.")
  44. for(int i=0;i<versionCodes.length;i++){
  45. String version=versionCodes[i]
  46. if (version.length()<=1){
  47. version="0"+version;
  48. }
  49. versionCodes[i]=version
  50. }
  51. String versionAllStr=""
  52. for (String version:versionCodes){
  53. versionAllStr+=version
  54. }
  55. code= (versionAllStr).toInteger()
  56. }
  57. return code
  58. }
  59. dependencies {
  60. implementation fileTree(dir: 'libs', include: ['*.jar'])
  61. implementation 'androidx.appcompat:appcompat:1.4.2'
  62. implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  63. implementation 'androidx.cardview:cardview:1.0.0'
  64. testImplementation 'junit:junit:4.12'
  65. implementation 'com.github.elinkthings:AILinkSDKRepositoryAndroid:1.14.1'//蓝牙核心库
  66. implementation 'com.github.elinkthings:AILinkSDKOtaLibraryAndroid:1.0.3'//OTA库,需要依赖核心库
  67. implementation 'com.github.elinkthings:AILinkSDKParsingLibraryAndroid:1.9.1'//蓝牙解析库
  68. implementation 'androidx.recyclerview:recyclerview:1.2.1'
  69. implementation 'com.jakewharton:butterknife:10.2.0'
  70. annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0'
  71. api 'com.squareup.retrofit2:converter-gson:2.5.0'
  72. // implementation (name: 'modulelibrary-release', ext: 'aar')
  73. }