Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

build.gradle 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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.9"
  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. testImplementation 'junit:junit:4.12'
  64. implementation 'com.github.elinkthings:AILinkSDKRepositoryAndroid:1.13.11'//蓝牙核心库
  65. implementation 'com.github.elinkthings:AILinkSDKOtaLibraryAndroid:1.0.3'//OTA库,需要依赖核心库
  66. implementation 'com.github.elinkthings:AILinkSDKParsingLibraryAndroid:1.8.4'//蓝牙解析库
  67. implementation 'androidx.recyclerview:recyclerview:1.2.1'
  68. implementation 'com.jakewharton:butterknife:10.2.0'
  69. annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0'
  70. api 'com.squareup.retrofit2:converter-gson:2.5.0'
  71. // implementation (name: 'modulelibrary-release', ext: 'aar')
  72. }