您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

build.gradle 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'com.jakewharton.butterknife'
  3. android {
  4. compileSdkVersion 34
  5. defaultConfig {
  6. applicationId "aicare.net.cn.sdk.ailinksdkdemoandroid"
  7. minSdkVersion 24
  8. targetSdkVersion 34
  9. versionName "1.15.05"
  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 JavaVersion.VERSION_1_8
  21. targetCompatibility JavaVersion.VERSION_1_8
  22. }
  23. repositories {
  24. flatDir {
  25. dirs project(':otalibrary').file('libs')
  26. dirs 'libs'
  27. }
  28. }
  29. sourceSets {
  30. main {
  31. jniLibs.srcDirs = ['libs']
  32. }
  33. }
  34. }
  35. static def getVersionCodeNumber(String versionName) {
  36. //1.49.13_beta05
  37. int code=0
  38. if (versionName!=null){
  39. String versionCodeStr=versionName+"80"
  40. if (versionName.contains("_")){
  41. String[] versionStr=versionName.split("_")
  42. versionCodeStr=versionStr[0]+"."+versionStr[1].substring(4)
  43. }
  44. String[] versionCodes=versionCodeStr.split("\\.")
  45. for(int i=0;i<versionCodes.length;i++){
  46. String version=versionCodes[i]
  47. if (version.length()<=1){
  48. version="0"+version;
  49. }
  50. versionCodes[i]=version
  51. }
  52. String versionAllStr=""
  53. for (String version:versionCodes){
  54. versionAllStr+=version
  55. }
  56. code= (versionAllStr).toInteger()
  57. }
  58. return code
  59. }
  60. dependencies {
  61. implementation fileTree(dir: 'libs', include: ['*.jar'])
  62. implementation 'androidx.appcompat:appcompat:1.4.2'
  63. implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  64. implementation 'androidx.cardview:cardview:1.0.0'
  65. testImplementation 'junit:junit:4.12'
  66. implementation 'com.github.elinkthings:AILinkSDKRepositoryAndroid:1.14.17'//蓝牙核心库
  67. implementation 'com.github.elinkthings:AILinkSDKParsingLibraryAndroid:1.9.6'//蓝牙解析库,需要依赖核心库
  68. implementation 'com.github.elinkthings:AILinkMqttRepositoryAndroid:1.2.0'//MQTT库
  69. implementation project(path: ':otalibrary')
  70. implementation 'androidx.recyclerview:recyclerview:1.3.2'
  71. implementation 'com.jakewharton:butterknife:10.2.3'
  72. annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
  73. api 'com.squareup.retrofit2:converter-gson:2.7.2'
  74. // implementation (name: 'modulelibrary-release', ext: 'aar')
  75. }