build.gradle 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. import java.text.SimpleDateFormat
  2. apply plugin: 'com.android.application'
  3. apply plugin: 'kotlin-android'
  4. apply plugin: 'kotlin-android-extensions'
  5. ext {
  6. // Git is needed in your system PATH for these commands to work.
  7. // If it's not installed, you can return a random value as a workaround
  8. getCommitCount = {
  9. return 'git rev-list --count HEAD'.execute().text.trim()
  10. // return "1"
  11. }
  12. getGitSha = {
  13. return 'git rev-parse --short HEAD'.execute().text.trim()
  14. // return "1"
  15. }
  16. getBuildTime = {
  17. def df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'")
  18. df.setTimeZone(TimeZone.getTimeZone("UTC"))
  19. return df.format(new Date())
  20. }
  21. }
  22. def includeUpdater() {
  23. return hasProperty("include_updater")
  24. }
  25. android {
  26. compileSdkVersion 23
  27. buildToolsVersion "23.0.3"
  28. publishNonDefault true
  29. defaultConfig {
  30. applicationId "eu.kanade.tachiyomi"
  31. minSdkVersion 16
  32. targetSdkVersion 23
  33. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  34. versionCode 10
  35. versionName "0.2.3"
  36. buildConfigField "String", "COMMIT_COUNT", "\"${getCommitCount()}\""
  37. buildConfigField "String", "COMMIT_SHA", "\"${getGitSha()}\""
  38. buildConfigField "String", "BUILD_TIME", "\"${getBuildTime()}\""
  39. buildConfigField "boolean", "INCLUDE_UPDATER", "${includeUpdater()}"
  40. vectorDrawables.useSupportLibrary = true
  41. }
  42. buildTypes {
  43. debug {
  44. versionNameSuffix "-${getCommitCount()}"
  45. applicationIdSuffix ".debug"
  46. }
  47. release {
  48. minifyEnabled true
  49. shrinkResources true
  50. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  51. }
  52. }
  53. packagingOptions {
  54. exclude 'META-INF/DEPENDENCIES'
  55. exclude 'LICENSE.txt'
  56. exclude 'META-INF/LICENSE'
  57. exclude 'META-INF/LICENSE.txt'
  58. exclude 'META-INF/NOTICE'
  59. }
  60. lintOptions {
  61. abortOnError false
  62. checkReleaseBuilds false
  63. }
  64. sourceSets {
  65. main.java.srcDirs += 'src/main/kotlin'
  66. }
  67. }
  68. dependencies {
  69. // Modified dependencies
  70. compile 'com.github.inorichi:subsampling-scale-image-view:421fb81'
  71. compile 'com.github.inorichi:ReactiveNetwork:69092ed'
  72. // Android support library
  73. final support_library_version = '23.4.0'
  74. compile "com.android.support:support-v4:$support_library_version"
  75. compile "com.android.support:appcompat-v7:$support_library_version"
  76. compile "com.android.support:cardview-v7:$support_library_version"
  77. compile "com.android.support:design:$support_library_version"
  78. compile "com.android.support:recyclerview-v7:$support_library_version"
  79. compile "com.android.support:support-annotations:$support_library_version"
  80. compile "com.android.support:customtabs:$support_library_version"
  81. // ReactiveX
  82. compile 'io.reactivex:rxandroid:1.2.1'
  83. compile 'io.reactivex:rxjava:1.1.6'
  84. compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.2'
  85. // Network client
  86. compile "com.squareup.okhttp3:okhttp:3.3.1"
  87. // REST
  88. final retrofit_version = '2.1.0'
  89. compile "com.squareup.retrofit2:retrofit:$retrofit_version"
  90. compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
  91. compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version"
  92. // IO
  93. compile 'com.squareup.okio:okio:1.8.0'
  94. // JSON
  95. compile 'com.google.code.gson:gson:2.7'
  96. compile 'com.github.salomonbrys.kotson:kotson:2.3.0'
  97. // YAML
  98. compile 'com.github.bmoliveira:snake-yaml:v1.18-android'
  99. // JavaScript engine
  100. compile 'com.squareup.duktape:duktape-android:0.9.5'
  101. // Disk cache
  102. compile 'com.jakewharton:disklrucache:2.0.2'
  103. // Parse HTML
  104. compile 'org.jsoup:jsoup:1.9.2'
  105. // Changelog
  106. compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
  107. // Database
  108. compile "com.pushtorefresh.storio:sqlite:1.9.0"
  109. // Model View Presenter
  110. final nucleus_version = '3.0.0'
  111. compile "info.android15.nucleus:nucleus:$nucleus_version"
  112. compile "info.android15.nucleus:nucleus-support-v4:$nucleus_version"
  113. compile "info.android15.nucleus:nucleus-support-v7:$nucleus_version"
  114. // Dependency injection
  115. compile "uy.kohesive.injekt:injekt-core:1.16.1"
  116. // Image library
  117. compile 'com.github.bumptech.glide:glide:3.7.0'
  118. compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar'
  119. // Logging
  120. compile 'com.jakewharton.timber:timber:4.1.2'
  121. // Crash reports
  122. compile 'ch.acra:acra:4.9.0'
  123. // UI
  124. compile 'com.dmitrymalkovich.android:material-design-dimens:1.2'
  125. compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
  126. compile 'eu.davidea:flexible-adapter:4.2.0'
  127. compile 'com.nononsenseapps:filepicker:2.5.2'
  128. compile 'com.github.amulyakhare:TextDrawable:558677e'
  129. compile 'com.afollestad.material-dialogs:core:0.8.6.1'
  130. compile 'net.xpece.android:support-preference:0.8.1'
  131. compile 'me.zhanghai.android.systemuihelper:library:1.0.0'
  132. compile 'org.adw.library:discrete-seekbar:1.0.1'
  133. // Tests
  134. testCompile 'junit:junit:4.12'
  135. testCompile 'org.assertj:assertj-core:1.7.1'
  136. testCompile 'org.mockito:mockito-core:1.10.19'
  137. testCompile 'org.robolectric:robolectric:3.1'
  138. compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  139. }
  140. buildscript {
  141. ext.kotlin_version = '1.0.3'
  142. repositories {
  143. mavenCentral()
  144. }
  145. dependencies {
  146. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  147. }
  148. }
  149. repositories {
  150. mavenCentral()
  151. }