build.gradle 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. import java.text.SimpleDateFormat
  2. apply plugin: 'com.android.application'
  3. apply plugin: 'kotlin-android'
  4. apply plugin: 'kotlin-android-extensions'
  5. if (file("custom.gradle").exists()) {
  6. apply from: "custom.gradle"
  7. }
  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 25
  27. buildToolsVersion "25.0.1"
  28. publishNonDefault true
  29. defaultConfig {
  30. applicationId "eu.kanade.tachiyomi"
  31. minSdkVersion 16
  32. targetSdkVersion 25
  33. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  34. versionCode 19
  35. versionName "0.4.2"
  36. buildConfigField "String", "COMMIT_COUNT", "\"${getCommitCount()}\""
  37. buildConfigField "String", "COMMIT_SHA", "\"${getGitSha()}\""
  38. buildConfigField "String", "BUILD_TIME", "\"${getBuildTime()}\""
  39. vectorDrawables.useSupportLibrary = true
  40. ndk {
  41. abiFilters "armeabi", "armeabi-v7a", "x86"
  42. }
  43. }
  44. buildTypes {
  45. debug {
  46. versionNameSuffix "-${getCommitCount()}"
  47. applicationIdSuffix ".debug"
  48. multiDexEnabled true
  49. }
  50. release {
  51. minifyEnabled true
  52. shrinkResources true
  53. multiDexEnabled false
  54. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  55. }
  56. }
  57. productFlavors {
  58. standard {
  59. buildConfigField "boolean", "INCLUDE_UPDATER", "true"
  60. }
  61. fdroid {
  62. buildConfigField "boolean", "INCLUDE_UPDATER", "false"
  63. }
  64. }
  65. packagingOptions {
  66. exclude 'META-INF/DEPENDENCIES'
  67. exclude 'LICENSE.txt'
  68. exclude 'META-INF/LICENSE'
  69. exclude 'META-INF/LICENSE.txt'
  70. exclude 'META-INF/NOTICE'
  71. }
  72. lintOptions {
  73. abortOnError false
  74. checkReleaseBuilds false
  75. }
  76. sourceSets {
  77. main.java.srcDirs += 'src/main/kotlin'
  78. }
  79. }
  80. dependencies {
  81. // Modified dependencies
  82. compile 'com.github.inorichi:subsampling-scale-image-view:44aa442'
  83. // Android support library
  84. final support_library_version = '25.1.0'
  85. compile "com.android.support:support-v4:$support_library_version"
  86. compile "com.android.support:appcompat-v7:$support_library_version"
  87. compile "com.android.support:cardview-v7:$support_library_version"
  88. compile "com.android.support:design:$support_library_version"
  89. compile "com.android.support:recyclerview-v7:$support_library_version"
  90. compile "com.android.support:support-annotations:$support_library_version"
  91. compile "com.android.support:customtabs:$support_library_version"
  92. compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
  93. compile 'com.android.support:multidex:1.0.1'
  94. // ReactiveX
  95. compile 'io.reactivex:rxandroid:1.2.1'
  96. compile 'io.reactivex:rxjava:1.2.5'
  97. compile 'com.jakewharton.rxrelay:rxrelay:1.2.0'
  98. compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.2'
  99. compile 'com.github.pwittchen:reactivenetwork:0.7.0'
  100. // Network client
  101. compile "com.squareup.okhttp3:okhttp:3.5.0"
  102. compile 'com.squareup.okio:okio:1.11.0'
  103. // REST
  104. final retrofit_version = '2.1.0'
  105. compile "com.squareup.retrofit2:retrofit:$retrofit_version"
  106. compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
  107. compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version"
  108. // JSON
  109. compile 'com.google.code.gson:gson:2.8.0'
  110. compile 'com.github.salomonbrys.kotson:kotson:2.5.0'
  111. // YAML
  112. compile 'com.github.bmoliveira:snake-yaml:v1.18-android'
  113. // JavaScript engine
  114. compile 'com.squareup.duktape:duktape-android:1.1.0'
  115. // Disk
  116. compile 'com.jakewharton:disklrucache:2.0.2'
  117. compile 'com.github.seven332:unifile:1.0.0'
  118. // HTML parser
  119. compile 'org.jsoup:jsoup:1.10.2'
  120. // Job scheduling
  121. compile 'com.evernote:android-job:1.1.4'
  122. compile 'com.google.android.gms:play-services-gcm:10.0.1'
  123. // Changelog
  124. compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
  125. // Database
  126. compile "com.pushtorefresh.storio:sqlite:1.12.1"
  127. // Model View Presenter
  128. final nucleus_version = '3.0.0'
  129. compile "info.android15.nucleus:nucleus:$nucleus_version"
  130. compile "info.android15.nucleus:nucleus-support-v4:$nucleus_version"
  131. compile "info.android15.nucleus:nucleus-support-v7:$nucleus_version"
  132. // Dependency injection
  133. compile "uy.kohesive.injekt:injekt-core:1.16.1"
  134. // Image library
  135. compile 'com.github.bumptech.glide:glide:3.7.0'
  136. compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar'
  137. // Transformations
  138. compile 'jp.wasabeef:glide-transformations:2.0.1'
  139. // Logging
  140. compile 'com.jakewharton.timber:timber:4.5.0'
  141. // Crash reports
  142. compile 'ch.acra:acra:4.9.2'
  143. // Sort
  144. compile 'com.github.gpanther:java-nat-sort:natural-comparator-1.1'
  145. // UI
  146. compile 'com.dmitrymalkovich.android:material-design-dimens:1.4'
  147. compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
  148. compile 'eu.davidea:flexible-adapter:5.0.0-rc1'
  149. compile 'com.github.inorichi:FlexibleAdapter:93985fe' // v4.2.0 to be removed
  150. compile 'com.nononsenseapps:filepicker:2.5.2'
  151. compile 'com.github.amulyakhare:TextDrawable:558677e'
  152. compile 'com.afollestad.material-dialogs:core:0.9.2.3'
  153. compile 'net.xpece.android:support-preference:1.2.2'
  154. compile 'me.zhanghai.android.systemuihelper:library:1.0.0'
  155. compile 'de.hdodenhof:circleimageview:2.1.0'
  156. // Tests
  157. testCompile 'junit:junit:4.12'
  158. testCompile 'org.assertj:assertj-core:1.7.1'
  159. testCompile 'org.mockito:mockito-core:1.10.19'
  160. final robolectric_version = '3.1.4'
  161. testCompile "org.robolectric:robolectric:$robolectric_version"
  162. testCompile "org.robolectric:shadows-multidex:$robolectric_version"
  163. testCompile "org.robolectric:shadows-play-services:$robolectric_version"
  164. compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  165. }
  166. buildscript {
  167. ext.kotlin_version = '1.0.6'
  168. repositories {
  169. mavenCentral()
  170. }
  171. dependencies {
  172. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  173. }
  174. }
  175. repositories {
  176. mavenCentral()
  177. }