build.gradle 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. plugins {
  2. id 'com.android.application'
  3. id 'kotlin-android'
  4. id 'de.mannodermaus.android-junit5'
  5. id 'kotlin-parcelize'
  6. id 'org.jetbrains.kotlin.android'
  7. id 'dev.rikka.tools.refine'
  8. }
  9. dependencies {
  10. implementation 'androidx.core:core-ktx:1.12.0'
  11. coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
  12. implementation 'androidx.appcompat:appcompat:1.6.1'
  13. implementation 'androidx.core:core-ktx:1.12.0'
  14. implementation 'androidx.work:work-runtime-ktx:2.8.1'
  15. // solve dependency conflict https://stackoverflow.com/a/69832319
  16. implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
  17. // has kotlinx-coroutines-android
  18. implementation 'androidx.preference:preference-ktx:1.2.1'
  19. // has coordinatorlayout, constraintlayout, cardview and more
  20. implementation 'com.google.android.material:material:1.10.0'
  21. implementation "androidx.compose.material3:material3:1.1.2"
  22. implementation 'androidx.annotation:annotation:1.7.0'
  23. // additional layout for then main screen
  24. implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
  25. // parse API responses in JSON
  26. implementation 'com.google.code.gson:gson:2.10.1'
  27. // compare versions of available and installed apps
  28. implementation 'io.github.g00fy2:versioncompare:1.5.0'
  29. // for file downloader
  30. implementation 'com.squareup.okhttp3:okhttp:4.11.0'
  31. implementation 'com.squareup.okhttp3:okhttp-dnsoverhttps:4.11.0'
  32. implementation 'ru.gildor.coroutines:kotlin-coroutines-okhttp:1.0'
  33. // for root installer
  34. implementation 'com.github.topjohnwu.libsu:core:5.2.0'
  35. // for Shizuku installer
  36. compileOnly "dev.rikka.hidden:stub:4.2.0"
  37. implementation "dev.rikka.tools.refine:runtime:4.3.0"
  38. def shizuku_version = '13.1.2'
  39. implementation "dev.rikka.shizuku:api:${shizuku_version}"
  40. implementation "dev.rikka.shizuku:provider:${shizuku_version}"
  41. implementation 'org.lsposed.hiddenapibypass:hiddenapibypass:4.3'
  42. // Aggregator dependency on JUnit api, engine, and params
  43. testImplementation 'org.junit.jupiter:junit-jupiter:5.9.3'
  44. testImplementation 'org.hamcrest:hamcrest-all:1.3'
  45. testImplementation 'io.mockk:mockk:1.13.5'
  46. testImplementation 'io.github.ivanshafran:shared-preferences-mock:1.2.4'
  47. testImplementation 'org.slf4j:slf4j-simple:2.0.9'
  48. }
  49. android {
  50. namespace = 'de.marmaro.krt.ffupdater'
  51. compileSdk 34
  52. defaultConfig {
  53. versionCode 170
  54. // (incompatible changes) . (backwards compatible functionality) . (backwards compatible bug fixes)
  55. versionName '79.2.0'
  56. minSdk 21
  57. targetSdk 34
  58. vectorDrawables.useSupportLibrary = true
  59. }
  60. buildFeatures {
  61. viewBinding = true
  62. }
  63. buildTypes {
  64. release {
  65. minifyEnabled true
  66. shrinkResources true
  67. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  68. }
  69. }
  70. compileOptions {
  71. encoding = "UTF-8"
  72. coreLibraryDesugaringEnabled true
  73. }
  74. kotlinOptions {
  75. jvmTarget = "1.8"
  76. }
  77. packagingOptions {
  78. resources {
  79. excludes += ['META-INF/NOTICE', 'META-INF/NOTICE.txt', 'META-INF/README', 'META-INF/README.txt',
  80. 'META-INF/LICENSE', 'META-INF/LICENSE.txt']
  81. }
  82. }
  83. testOptions {
  84. // workaround for "Method i in android.util.Log not mocked"
  85. // without PowerMockito it is impossible to mock Log.
  86. unitTests.returnDefaultValues = true
  87. unitTests.includeAndroidResources = true
  88. unitTests.all {
  89. maxParallelForks = Runtime.runtime.availableProcessors()
  90. testLogging {
  91. events "passed", "skipped", "failed", "standardOut", "standardError"
  92. outputs.upToDateWhen { false }
  93. showStandardStreams = true
  94. }
  95. }
  96. }
  97. lint {
  98. abortOnError false
  99. }
  100. androidResources {
  101. additionalParameters '--warn-manifest-validation'
  102. }
  103. // remove the Dependency Info Block
  104. // https://gitlab.com/fdroid/fdroiddata/-/merge_requests/13812#note_1592074265
  105. dependenciesInfo {
  106. // Disables dependency metadata when building APKs.
  107. includeInApk = false
  108. // Disables dependency metadata when building Android App Bundles.
  109. includeInBundle = false
  110. }
  111. }
  112. tasks.register('printVersionName') {
  113. doLast {
  114. println android.defaultConfig.versionName
  115. }
  116. }
  117. tasks.register('printVersionCode') {
  118. doLast {
  119. println android.defaultConfig.versionCode
  120. }
  121. }