build.gradle 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. import java.text.SimpleDateFormat
  2. apply plugin: 'com.android.application'
  3. apply plugin: 'kotlin-android'
  4. apply plugin: 'kotlin-android-extensions'
  5. apply plugin: 'kotlin-kapt'
  6. apply plugin: 'com.github.zellius.shortcut-helper'
  7. shortcutHelper.filePath = './shortcuts.xml'
  8. ext {
  9. // Git is needed in your system PATH for these commands to work.
  10. // If it's not installed, you can return a random value as a workaround
  11. getCommitCount = {
  12. return 'git rev-list --count HEAD'.execute().text.trim()
  13. // return "1"
  14. }
  15. getGitSha = {
  16. return 'git rev-parse --short HEAD'.execute().text.trim()
  17. // return "1"
  18. }
  19. getBuildTime = {
  20. def df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'")
  21. df.setTimeZone(TimeZone.getTimeZone("UTC"))
  22. return df.format(new Date())
  23. }
  24. }
  25. android {
  26. compileSdkVersion 29
  27. buildToolsVersion '29.0.2'
  28. publishNonDefault true
  29. defaultConfig {
  30. applicationId "eu.kanade.tachiyomi"
  31. minSdkVersion 21
  32. targetSdkVersion 29
  33. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  34. versionCode 41
  35. versionName "0.8.4"
  36. buildConfigField "String", "COMMIT_COUNT", "\"${getCommitCount()}\""
  37. buildConfigField "String", "COMMIT_SHA", "\"${getGitSha()}\""
  38. buildConfigField "String", "BUILD_TIME", "\"${getBuildTime()}\""
  39. buildConfigField "boolean", "INCLUDE_UPDATER", "false"
  40. vectorDrawables.useSupportLibrary = true
  41. multiDexEnabled true
  42. ndk {
  43. abiFilters "armeabi-v7a", "arm64-v8a", "x86"
  44. }
  45. }
  46. buildTypes {
  47. debug {
  48. versionNameSuffix "-${getCommitCount()}"
  49. applicationIdSuffix ".debug"
  50. }
  51. }
  52. flavorDimensions "default"
  53. productFlavors {
  54. standard {
  55. buildConfigField "boolean", "INCLUDE_UPDATER", "true"
  56. dimension "default"
  57. }
  58. fdroid {
  59. dimension "default"
  60. }
  61. dev {
  62. resConfigs "en", "xxhdpi"
  63. dimension "default"
  64. }
  65. }
  66. packagingOptions {
  67. exclude 'META-INF/DEPENDENCIES'
  68. exclude 'LICENSE.txt'
  69. exclude 'META-INF/LICENSE'
  70. exclude 'META-INF/LICENSE.txt'
  71. exclude 'META-INF/NOTICE'
  72. }
  73. lintOptions {
  74. abortOnError false
  75. checkReleaseBuilds false
  76. }
  77. compileOptions {
  78. sourceCompatibility = 1.8
  79. targetCompatibility = 1.8
  80. }
  81. kotlinOptions {
  82. jvmTarget = "1.8"
  83. }
  84. }
  85. dependencies {
  86. // Modified dependencies
  87. implementation 'com.github.inorichi:subsampling-scale-image-view:ac0dae7'
  88. implementation 'com.github.inorichi:junrar-android:634c1f5'
  89. // Android support library
  90. implementation 'androidx.appcompat:appcompat:1.1.0'
  91. implementation 'androidx.cardview:cardview:1.0.0'
  92. implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  93. implementation 'androidx.recyclerview:recyclerview:1.1.0'
  94. implementation 'androidx.preference:preference:1.1.0'
  95. implementation 'androidx.annotation:annotation:1.1.0'
  96. implementation 'androidx.browser:browser:1.2.0'
  97. implementation 'androidx.multidex:multidex:2.0.1'
  98. implementation 'androidx.biometric:biometric:1.0.1'
  99. final lifecycle_version = '2.1.0'
  100. implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
  101. implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
  102. // UI library
  103. implementation 'com.google.android.material:material:1.1.0'
  104. standardImplementation 'com.google.firebase:firebase-core:17.2.2'
  105. // ReactiveX
  106. implementation 'io.reactivex:rxandroid:1.2.1'
  107. implementation 'io.reactivex:rxjava:1.3.8'
  108. implementation 'com.jakewharton.rxrelay:rxrelay:1.2.0'
  109. implementation 'com.f2prateek.rx.preferences:rx-preferences:1.0.2'
  110. implementation 'com.github.pwittchen:reactivenetwork:0.13.0'
  111. // Network client
  112. final okhttp_version = '4.3.1'
  113. implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
  114. implementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version"
  115. implementation 'com.squareup.okio:okio:2.4.3'
  116. // REST
  117. final retrofit_version = '2.7.1'
  118. implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
  119. implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
  120. implementation "com.squareup.retrofit2:adapter-rxjava:$retrofit_version"
  121. // JSON
  122. implementation 'com.google.code.gson:gson:2.8.6'
  123. implementation 'com.github.salomonbrys.kotson:kotson:2.5.0'
  124. // JavaScript engine
  125. implementation 'com.squareup.duktape:duktape-android:1.3.0'
  126. // Disk
  127. implementation 'com.jakewharton:disklrucache:2.0.2'
  128. implementation 'com.github.inorichi:unifile:e9ee588'
  129. // HTML parser
  130. implementation 'org.jsoup:jsoup:1.12.1'
  131. // Job scheduling
  132. implementation 'com.evernote:android-job:1.2.5'
  133. implementation 'com.google.android.gms:play-services-gcm:17.0.0'
  134. // Changelog
  135. implementation 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
  136. // Database
  137. implementation 'androidx.sqlite:sqlite:2.1.0'
  138. implementation 'com.github.inorichi.storio:storio-common:8be19de@aar'
  139. implementation 'com.github.inorichi.storio:storio-sqlite:8be19de@aar'
  140. implementation 'io.requery:sqlite-android:3.25.2'
  141. // Model View Presenter
  142. final nucleus_version = '3.0.0'
  143. implementation "info.android15.nucleus:nucleus:$nucleus_version"
  144. implementation "info.android15.nucleus:nucleus-support-v7:$nucleus_version"
  145. // Dependency injection
  146. implementation "com.github.inorichi.injekt:injekt-core:65b0440"
  147. // Image library
  148. final glide_version = '4.11.0'
  149. implementation "com.github.bumptech.glide:glide:$glide_version"
  150. implementation "com.github.bumptech.glide:okhttp3-integration:$glide_version"
  151. kapt "com.github.bumptech.glide:compiler:$glide_version"
  152. // Transformations
  153. implementation 'jp.wasabeef:glide-transformations:4.0.0'
  154. // Logging
  155. implementation 'com.jakewharton.timber:timber:4.7.1'
  156. // Crash reports
  157. implementation 'ch.acra:acra:4.9.2'
  158. // UI
  159. implementation 'com.dmitrymalkovich.android:material-design-dimens:1.4'
  160. implementation 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
  161. implementation 'eu.davidea:flexible-adapter:5.1.0'
  162. implementation 'eu.davidea:flexible-adapter-ui:1.0.0'
  163. implementation 'com.nononsenseapps:filepicker:2.5.2'
  164. implementation 'com.github.amulyakhare:TextDrawable:558677e'
  165. implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
  166. implementation 'me.zhanghai.android.systemuihelper:library:1.0.0'
  167. implementation 'com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.1.0'
  168. implementation 'com.github.mthli:Slice:v1.2'
  169. implementation 'me.gujun.android.taggroup:library:1.4@aar'
  170. implementation 'com.github.chrisbanes:PhotoView:2.3.0'
  171. implementation 'com.github.carlosesco:DirectionalViewPager:a844dbca0a'
  172. // Conductor
  173. implementation 'com.bluelinelabs:conductor:2.1.5'
  174. implementation ("com.bluelinelabs:conductor-support:2.1.5") {
  175. exclude group: "com.android.support"
  176. }
  177. implementation 'com.github.inorichi:conductor-support-preference:a32c357'
  178. // RxBindings
  179. final rxbindings_version = '1.0.1'
  180. implementation "com.jakewharton.rxbinding:rxbinding-kotlin:$rxbindings_version"
  181. implementation "com.jakewharton.rxbinding:rxbinding-appcompat-v7-kotlin:$rxbindings_version"
  182. implementation "com.jakewharton.rxbinding:rxbinding-support-v4-kotlin:$rxbindings_version"
  183. implementation "com.jakewharton.rxbinding:rxbinding-recyclerview-v7-kotlin:$rxbindings_version"
  184. // Tests
  185. testImplementation 'junit:junit:4.13'
  186. testImplementation 'org.assertj:assertj-core:1.7.1'
  187. testImplementation 'org.mockito:mockito-core:1.10.19'
  188. final robolectric_version = '3.1.4'
  189. testImplementation "org.robolectric:robolectric:$robolectric_version"
  190. testImplementation "org.robolectric:shadows-multidex:$robolectric_version"
  191. testImplementation "org.robolectric:shadows-play-services:$robolectric_version"
  192. implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  193. final coroutines_version = '1.3.3'
  194. implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
  195. }
  196. buildscript {
  197. ext.kotlin_version = '1.3.61'
  198. repositories {
  199. mavenCentral()
  200. }
  201. dependencies {
  202. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  203. }
  204. }
  205. repositories {
  206. mavenCentral()
  207. }
  208. // See https://kotlinlang.org/docs/reference/experimental.html#experimental-status-of-experimental-api-markers
  209. tasks.withType(org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile).all {
  210. kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlin.Experimental"]
  211. }
  212. androidExtensions {
  213. experimental = true
  214. }
  215. if (getGradle().getStartParameter().getTaskRequests().toString().contains("Standard")) {
  216. apply plugin: 'com.google.gms.google-services'
  217. }