build.gradle 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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. def includeUpdater() {
  26. return hasProperty("include_updater")
  27. }
  28. android {
  29. compileSdkVersion 24
  30. buildToolsVersion "24.0.2"
  31. publishNonDefault true
  32. defaultConfig {
  33. applicationId "eu.kanade.tachiyomi"
  34. minSdkVersion 16
  35. targetSdkVersion 24
  36. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  37. versionCode 10
  38. versionName "0.2.3"
  39. buildConfigField "String", "COMMIT_COUNT", "\"${getCommitCount()}\""
  40. buildConfigField "String", "COMMIT_SHA", "\"${getGitSha()}\""
  41. buildConfigField "String", "BUILD_TIME", "\"${getBuildTime()}\""
  42. buildConfigField "boolean", "INCLUDE_UPDATER", "${includeUpdater()}"
  43. vectorDrawables.useSupportLibrary = true
  44. ndk {
  45. abiFilters "armeabi", "armeabi-v7a", "x86"
  46. }
  47. }
  48. buildTypes {
  49. debug {
  50. versionNameSuffix "-${getCommitCount()}"
  51. applicationIdSuffix ".debug"
  52. }
  53. release {
  54. minifyEnabled true
  55. shrinkResources true
  56. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  57. }
  58. }
  59. packagingOptions {
  60. exclude 'META-INF/DEPENDENCIES'
  61. exclude 'LICENSE.txt'
  62. exclude 'META-INF/LICENSE'
  63. exclude 'META-INF/LICENSE.txt'
  64. exclude 'META-INF/NOTICE'
  65. }
  66. lintOptions {
  67. abortOnError false
  68. checkReleaseBuilds false
  69. }
  70. sourceSets {
  71. main.java.srcDirs += 'src/main/kotlin'
  72. }
  73. }
  74. dependencies {
  75. // Modified dependencies
  76. compile 'com.github.inorichi:subsampling-scale-image-view:2d9c854'
  77. compile 'com.github.inorichi:ReactiveNetwork:69092ed'
  78. // Android support library
  79. final support_library_version = '24.2.1'
  80. compile "com.android.support:support-v4:$support_library_version"
  81. compile "com.android.support:appcompat-v7:$support_library_version"
  82. compile "com.android.support:cardview-v7:$support_library_version"
  83. compile "com.android.support:design:$support_library_version"
  84. compile "com.android.support:recyclerview-v7:$support_library_version"
  85. compile "com.android.support:support-annotations:$support_library_version"
  86. compile "com.android.support:customtabs:$support_library_version"
  87. compile 'com.google.android.gms:play-services-gcm:9.6.1'
  88. // ReactiveX
  89. compile 'io.reactivex:rxandroid:1.2.1'
  90. compile 'io.reactivex:rxjava:1.2.1'
  91. compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.2'
  92. // Network client
  93. compile "com.squareup.okhttp3:okhttp:3.4.1"
  94. // REST
  95. final retrofit_version = '2.1.0'
  96. compile "com.squareup.retrofit2:retrofit:$retrofit_version"
  97. compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
  98. compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version"
  99. // IO
  100. compile 'com.squareup.okio:okio:1.10.0'
  101. // JSON
  102. compile 'com.google.code.gson:gson:2.7'
  103. compile 'com.github.salomonbrys.kotson:kotson:2.4.0'
  104. // YAML
  105. compile 'com.github.bmoliveira:snake-yaml:v1.18-android'
  106. // JavaScript engine
  107. compile 'com.squareup.duktape:duktape-android:1.0.0'
  108. // Disk cache
  109. compile 'com.jakewharton:disklrucache:2.0.2'
  110. // Parse HTML
  111. compile 'org.jsoup:jsoup:1.9.2'
  112. // Changelog
  113. compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
  114. // Database
  115. compile "com.pushtorefresh.storio:sqlite:1.11.0"
  116. // Model View Presenter
  117. final nucleus_version = '3.0.0'
  118. compile "info.android15.nucleus:nucleus:$nucleus_version"
  119. compile "info.android15.nucleus:nucleus-support-v4:$nucleus_version"
  120. compile "info.android15.nucleus:nucleus-support-v7:$nucleus_version"
  121. // Dependency injection
  122. compile "uy.kohesive.injekt:injekt-core:1.16.1"
  123. // Image library
  124. compile 'com.github.bumptech.glide:glide:3.7.0'
  125. compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar'
  126. // Transformations
  127. compile 'jp.wasabeef:glide-transformations:2.0.1'
  128. // Logging
  129. compile 'com.jakewharton.timber:timber:4.3.1'
  130. // Crash reports
  131. compile 'ch.acra:acra:4.9.1'
  132. // UI
  133. compile 'com.dmitrymalkovich.android:material-design-dimens:1.4'
  134. compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
  135. compile 'eu.davidea:flexible-adapter:4.2.0'
  136. compile 'com.nononsenseapps:filepicker:2.5.2'
  137. compile 'com.github.amulyakhare:TextDrawable:558677e'
  138. compile 'com.afollestad.material-dialogs:core:0.9.0.2'
  139. compile 'net.xpece.android:support-preference:1.0.3'
  140. compile 'me.zhanghai.android.systemuihelper:library:1.0.0'
  141. compile 'de.hdodenhof:circleimageview:2.1.0'
  142. // Tests
  143. testCompile 'junit:junit:4.12'
  144. testCompile 'org.assertj:assertj-core:1.7.1'
  145. testCompile 'org.mockito:mockito-core:1.10.19'
  146. testCompile 'org.robolectric:robolectric:3.1.2'
  147. compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  148. }
  149. buildscript {
  150. ext.kotlin_version = '1.0.4'
  151. repositories {
  152. mavenCentral()
  153. }
  154. dependencies {
  155. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  156. }
  157. }
  158. repositories {
  159. mavenCentral()
  160. }