build.gradle 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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 26
  27. buildToolsVersion "26.0.2"
  28. publishNonDefault true
  29. defaultConfig {
  30. applicationId "eu.kanade.tachiyomi"
  31. minSdkVersion 16
  32. targetSdkVersion 26
  33. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  34. versionCode 26
  35. versionName "0.6.3"
  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. ndk {
  42. abiFilters "armeabi-v7a", "arm64-v8a", "x86"
  43. }
  44. }
  45. buildTypes {
  46. debug {
  47. versionNameSuffix "-${getCommitCount()}"
  48. applicationIdSuffix ".debug"
  49. multiDexEnabled true
  50. }
  51. release {
  52. minifyEnabled true
  53. shrinkResources true
  54. multiDexEnabled false
  55. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  56. }
  57. }
  58. flavorDimensions "default"
  59. productFlavors {
  60. standard {
  61. buildConfigField "boolean", "INCLUDE_UPDATER", "true"
  62. dimension "default"
  63. }
  64. fdroid {
  65. dimension "default"
  66. }
  67. dev {
  68. minSdkVersion 21
  69. resConfigs "en", "xxhdpi"
  70. dimension "default"
  71. }
  72. }
  73. packagingOptions {
  74. exclude 'META-INF/DEPENDENCIES'
  75. exclude 'LICENSE.txt'
  76. exclude 'META-INF/LICENSE'
  77. exclude 'META-INF/LICENSE.txt'
  78. exclude 'META-INF/NOTICE'
  79. }
  80. lintOptions {
  81. abortOnError false
  82. checkReleaseBuilds false
  83. }
  84. }
  85. dependencies {
  86. // Modified dependencies
  87. compile 'com.github.inorichi:subsampling-scale-image-view:01e5385'
  88. compile 'com.github.inorichi:tachimage:68cd311'
  89. compile 'com.github.inorichi:junrar-android:634c1f5'
  90. // Android support library
  91. final support_library_version = '26.1.0'
  92. compile "com.android.support:support-v4:$support_library_version"
  93. compile "com.android.support:appcompat-v7:$support_library_version"
  94. compile "com.android.support:cardview-v7:$support_library_version"
  95. compile "com.android.support:design:$support_library_version"
  96. compile "com.android.support:recyclerview-v7:$support_library_version"
  97. compile "com.android.support:preference-v7:$support_library_version"
  98. compile "com.android.support:support-annotations:$support_library_version"
  99. compile "com.android.support:customtabs:$support_library_version"
  100. compile 'com.android.support.constraint:constraint-layout:1.0.2'
  101. compile 'com.android.support:multidex:1.0.1'
  102. // ReactiveX
  103. compile 'io.reactivex:rxandroid:1.2.1'
  104. compile 'io.reactivex:rxjava:1.3.2'
  105. compile 'com.jakewharton.rxrelay:rxrelay:1.2.0'
  106. compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.2'
  107. compile 'com.github.pwittchen:reactivenetwork:0.7.0'
  108. // Network client
  109. compile "com.squareup.okhttp3:okhttp:3.9.0"
  110. compile 'com.squareup.okio:okio:1.13.0'
  111. // REST
  112. final retrofit_version = '2.3.0'
  113. compile "com.squareup.retrofit2:retrofit:$retrofit_version"
  114. compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
  115. compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version"
  116. // JSON
  117. compile 'com.google.code.gson:gson:2.8.2'
  118. compile 'com.github.salomonbrys.kotson:kotson:2.5.0'
  119. // YAML
  120. compile 'com.github.bmoliveira:snake-yaml:v1.18-android'
  121. // JavaScript engine
  122. compile 'com.squareup.duktape:duktape-android:1.2.0'
  123. // Disk
  124. compile 'com.jakewharton:disklrucache:2.0.2'
  125. compile 'com.github.seven332:unifile:1.0.0'
  126. // HTML parser
  127. compile 'org.jsoup:jsoup:1.10.2'
  128. // Job scheduling
  129. compile 'com.evernote:android-job:1.1.11'
  130. compile 'com.google.android.gms:play-services-gcm:11.4.0'
  131. // Changelog
  132. compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
  133. // Database
  134. compile "com.pushtorefresh.storio:sqlite:1.13.0"
  135. // Model View Presenter
  136. final nucleus_version = '3.0.0'
  137. compile "info.android15.nucleus:nucleus:$nucleus_version"
  138. compile "info.android15.nucleus:nucleus-support-v7:$nucleus_version"
  139. // Dependency injection
  140. compile "uy.kohesive.injekt:injekt-core:1.16.1"
  141. // Image library
  142. final glide_version = '4.2.0'
  143. compile "com.github.bumptech.glide:glide:$glide_version"
  144. compile "com.github.bumptech.glide:okhttp3-integration:$glide_version"
  145. kapt "com.github.bumptech.glide:compiler:$glide_version"
  146. // Transformations
  147. compile 'jp.wasabeef:glide-transformations:3.0.1'
  148. // Logging
  149. compile 'com.jakewharton.timber:timber:4.5.1'
  150. // Crash reports
  151. compile 'ch.acra:acra:4.9.2'
  152. // Sort
  153. compile 'com.github.gpanther:java-nat-sort:natural-comparator-1.1'
  154. // UI
  155. compile 'com.dmitrymalkovich.android:material-design-dimens:1.4'
  156. compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
  157. compile 'eu.davidea:flexible-adapter:5.0.0-rc1'
  158. compile 'com.nononsenseapps:filepicker:2.5.2'
  159. compile 'com.github.amulyakhare:TextDrawable:558677e'
  160. compile('com.afollestad.material-dialogs:core:0.9.4.7') {
  161. exclude group: "com.android.support", module: "support-v13"
  162. }
  163. compile 'me.zhanghai.android.systemuihelper:library:1.0.0'
  164. compile 'com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.0.4'
  165. compile 'com.github.mthli:Slice:v1.2'
  166. // Conductor
  167. compile "com.bluelinelabs:conductor:2.1.4"
  168. compile 'com.github.inorichi:conductor-support-preference:26.0.2'
  169. // RxBindings
  170. final rxbindings_version = '1.0.1'
  171. compile "com.jakewharton.rxbinding:rxbinding-kotlin:$rxbindings_version"
  172. compile "com.jakewharton.rxbinding:rxbinding-appcompat-v7-kotlin:$rxbindings_version"
  173. compile "com.jakewharton.rxbinding:rxbinding-support-v4-kotlin:$rxbindings_version"
  174. compile "com.jakewharton.rxbinding:rxbinding-recyclerview-v7-kotlin:$rxbindings_version"
  175. // Tests
  176. testCompile 'junit:junit:4.12'
  177. testCompile 'org.assertj:assertj-core:1.7.1'
  178. testCompile 'org.mockito:mockito-core:1.10.19'
  179. final robolectric_version = '3.1.4'
  180. testCompile "org.robolectric:robolectric:$robolectric_version"
  181. testCompile "org.robolectric:shadows-multidex:$robolectric_version"
  182. testCompile "org.robolectric:shadows-play-services:$robolectric_version"
  183. compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  184. final coroutines_version = '0.19.1'
  185. compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
  186. compile "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
  187. }
  188. buildscript {
  189. ext.kotlin_version = '1.1.51'
  190. repositories {
  191. mavenCentral()
  192. }
  193. dependencies {
  194. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  195. }
  196. }
  197. repositories {
  198. mavenCentral()
  199. }
  200. kotlin {
  201. experimental {
  202. coroutines 'enable'
  203. }
  204. }