build.gradle 6.3 KB

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