build.gradle 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. plugins {
  2. id 'com.android.application'
  3. id 'org.jetbrains.kotlin.android'
  4. }
  5. apply plugin: 'kotlin-kapt'
  6. android {
  7. compileSdk 32
  8. defaultConfig {
  9. applicationId "com.sikey.commonservice"
  10. minSdk 27
  11. targetSdk 32
  12. versionCode 1
  13. versionName "1.0"
  14. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  15. }
  16. buildFeatures {
  17. viewBinding = true
  18. buildConfig = true
  19. }
  20. buildTypes {
  21. debug {
  22. minifyEnabled false
  23. zipAlignEnabled false
  24. shrinkResources false
  25. buildConfigField "boolean", "LOGGER_DEBUG", "true"
  26. }
  27. release {
  28. buildConfigField "boolean", "LOGGER_DEBUG", "false"
  29. minifyEnabled true
  30. zipAlignEnabled true
  31. shrinkResources true
  32. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  33. }
  34. }
  35. kapt {
  36. arguments {
  37. arg("room.schemaLocation", "$projectDir/schemas".toString())
  38. }
  39. }
  40. packagingOptions {
  41. resources {
  42. excludes += ['META-INF/DEPENDENCIES']
  43. }
  44. }
  45. compileOptions {
  46. sourceCompatibility JavaVersion.VERSION_17
  47. targetCompatibility JavaVersion.VERSION_17
  48. }
  49. namespace 'com.sikey.commonservice'
  50. lint {
  51. baseline = file("lint-baseline.xml")
  52. }
  53. applicationVariants.all { variant ->
  54. def outputFileDir = "..\\"
  55. variant.outputs.all {
  56. def fileName = outputFile.name.replace(outputFile.name, "SikeyCommonService.apk")
  57. outputFileName = fileName
  58. }
  59. variant.getAssembleProvider().configure() {
  60. it..doLast {
  61. File out = new File(outputFileDir)
  62. copy {
  63. variant.outputs.forEach { output ->
  64. copy {
  65. from output.outputFile
  66. into out
  67. }
  68. }
  69. }
  70. }
  71. }
  72. }
  73. }
  74. //Add this to get SystemProperties
  75. String SDK_DIR = System.getenv("ANDROID_SDK_HOME")
  76. if (SDK_DIR == null) {
  77. Properties properties = new Properties()
  78. properties.load(new FileInputStream(project.rootProject.file("local.properties")))
  79. SDK_DIR = properties.get('sdk.dir')
  80. }
  81. //Add this to get SystemProperties end
  82. dependencies {
  83. implementation files('libs\\udid-1.2.jar')
  84. implementation files('libs\\ota-sdk-20230913.aar')
  85. implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
  86. implementation 'com.google.android.material:material:1.4.0'
  87. implementation 'androidx.appcompat:appcompat:1.4.2'
  88. implementation 'androidx.core:core-ktx:1.7.0'
  89. implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  90. implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
  91. implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
  92. implementation 'androidx.activity:activity-ktx:1.4.0'
  93. implementation 'androidx.fragment:fragment-ktx:1.4.1'
  94. implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  95. testImplementation 'junit:junit:4.13.2'
  96. androidTestImplementation 'androidx.test.ext:junit:1.1.3'
  97. androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
  98. //retrofit
  99. implementation 'com.squareup.retrofit2:retrofit:2.9.0'
  100. implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
  101. implementation 'com.squareup.retrofit2:adapter-rxjava2:2.9.0'
  102. implementation 'com.squareup.retrofit2:retrofit-converters:2.5.0'
  103. implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.10'
  104. implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
  105. implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
  106. //gson
  107. implementation 'com.google.code.gson:gson:2.9.0'
  108. //kotlin coroutines
  109. implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0"
  110. implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0"
  111. //room
  112. def roomVersion = "2.4.2"
  113. implementation("androidx.room:room-runtime:$roomVersion")
  114. // annotationProcessor("androidx.room:room-compiler:$roomVersion")
  115. implementation("androidx.room:room-ktx:$roomVersion")
  116. // To use Kotlin annotation processing tool (kapt)
  117. kapt("androidx.room:room-compiler:$roomVersion")
  118. //Add this to get SystemProperties
  119. compileOnly(files("${SDK_DIR}/platforms/android-24/data/layoutlib.jar"))
  120. }