build.gradle 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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 16
  35. versionName "0.4.0"
  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:f687b74'
  83. // Android support library
  84. final support_library_version = '25.0.1'
  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:multidex:1.0.1'
  93. // ReactiveX
  94. compile 'io.reactivex:rxandroid:1.2.1'
  95. compile 'io.reactivex:rxjava:1.2.3'
  96. compile 'com.jakewharton.rxrelay:rxrelay:1.2.0'
  97. compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.2'
  98. compile 'com.github.pwittchen:reactivenetwork:0.6.0'
  99. // Network client
  100. compile "com.squareup.okhttp3:okhttp:3.5.0"
  101. compile 'com.squareup.okio:okio:1.11.0'
  102. // REST
  103. final retrofit_version = '2.1.0'
  104. compile "com.squareup.retrofit2:retrofit:$retrofit_version"
  105. compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
  106. compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version"
  107. // JSON
  108. compile 'com.google.code.gson:gson:2.8.0'
  109. compile 'com.github.salomonbrys.kotson:kotson:2.4.0'
  110. // YAML
  111. compile 'com.github.bmoliveira:snake-yaml:v1.18-android'
  112. // JavaScript engine
  113. compile 'com.squareup.duktape:duktape-android:1.1.0'
  114. // Disk
  115. compile 'com.jakewharton:disklrucache:2.0.2'
  116. compile 'com.github.seven332:unifile:1.0.0'
  117. // HTML parser
  118. compile 'org.jsoup:jsoup:1.10.1'
  119. // Job scheduling
  120. compile 'com.evernote:android-job:1.1.3'
  121. compile 'com.google.android.gms:play-services-gcm:10.0.1'
  122. // Changelog
  123. compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
  124. // Database
  125. compile "com.pushtorefresh.storio:sqlite:1.11.0"
  126. // Model View Presenter
  127. final nucleus_version = '3.0.0'
  128. compile "info.android15.nucleus:nucleus:$nucleus_version"
  129. compile "info.android15.nucleus:nucleus-support-v4:$nucleus_version"
  130. compile "info.android15.nucleus:nucleus-support-v7:$nucleus_version"
  131. // Dependency injection
  132. compile "uy.kohesive.injekt:injekt-core:1.16.1"
  133. // Image library
  134. compile 'com.github.bumptech.glide:glide:3.7.0'
  135. compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar'
  136. // Transformations
  137. compile 'jp.wasabeef:glide-transformations:2.0.1'
  138. // Logging
  139. compile 'com.jakewharton.timber:timber:4.3.1'
  140. // Crash reports
  141. compile 'ch.acra:acra:4.9.1'
  142. // UI
  143. compile 'com.dmitrymalkovich.android:material-design-dimens:1.4'
  144. compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
  145. compile 'eu.davidea:flexible-adapter:4.2.0'
  146. compile 'com.nononsenseapps:filepicker:2.5.2'
  147. compile 'com.github.amulyakhare:TextDrawable:558677e'
  148. compile 'com.afollestad.material-dialogs:core:0.9.1.0'
  149. compile 'net.xpece.android:support-preference:1.2.0'
  150. compile 'me.zhanghai.android.systemuihelper:library:1.0.0'
  151. compile 'de.hdodenhof:circleimageview:2.1.0'
  152. // Tests
  153. testCompile 'junit:junit:4.12'
  154. testCompile 'org.assertj:assertj-core:1.7.1'
  155. testCompile 'org.mockito:mockito-core:1.10.19'
  156. final robolectric_version = '3.1.4'
  157. testCompile "org.robolectric:robolectric:$robolectric_version"
  158. testCompile "org.robolectric:shadows-multidex:$robolectric_version"
  159. testCompile "org.robolectric:shadows-play-services:$robolectric_version"
  160. compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  161. }
  162. buildscript {
  163. ext.kotlin_version = '1.0.5-2'
  164. repositories {
  165. mavenCentral()
  166. }
  167. dependencies {
  168. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  169. }
  170. }
  171. repositories {
  172. mavenCentral()
  173. }