build.gradle 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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 13
  38. versionName "0.3.2"
  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. multiDexEnabled true
  53. }
  54. release {
  55. minifyEnabled true
  56. shrinkResources true
  57. multiDexEnabled false
  58. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  59. }
  60. }
  61. packagingOptions {
  62. exclude 'META-INF/DEPENDENCIES'
  63. exclude 'LICENSE.txt'
  64. exclude 'META-INF/LICENSE'
  65. exclude 'META-INF/LICENSE.txt'
  66. exclude 'META-INF/NOTICE'
  67. }
  68. lintOptions {
  69. abortOnError false
  70. checkReleaseBuilds false
  71. }
  72. sourceSets {
  73. main.java.srcDirs += 'src/main/kotlin'
  74. }
  75. }
  76. dependencies {
  77. // Modified dependencies
  78. compile 'com.github.inorichi:subsampling-scale-image-view:96d2c7f'
  79. compile 'com.github.inorichi:ReactiveNetwork:69092ed'
  80. // Android support library
  81. final support_library_version = '24.2.1'
  82. compile "com.android.support:support-v4:$support_library_version"
  83. compile "com.android.support:appcompat-v7:$support_library_version"
  84. compile "com.android.support:cardview-v7:$support_library_version"
  85. compile "com.android.support:design:$support_library_version"
  86. compile "com.android.support:recyclerview-v7:$support_library_version"
  87. compile "com.android.support:support-annotations:$support_library_version"
  88. compile "com.android.support:customtabs:$support_library_version"
  89. compile 'com.android.support:multidex:1.0.1'
  90. compile 'com.google.android.gms:play-services-gcm:9.8.0'
  91. // ReactiveX
  92. compile 'io.reactivex:rxandroid:1.2.1'
  93. compile 'io.reactivex:rxjava:1.2.1'
  94. compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.2'
  95. // Network client
  96. compile "com.squareup.okhttp3:okhttp:3.4.1"
  97. // REST
  98. final retrofit_version = '2.1.0'
  99. compile "com.squareup.retrofit2:retrofit:$retrofit_version"
  100. compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
  101. compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version"
  102. // IO
  103. compile 'com.squareup.okio:okio:1.10.0'
  104. // JSON
  105. compile 'com.google.code.gson:gson:2.7'
  106. compile 'com.github.salomonbrys.kotson:kotson:2.4.0'
  107. // YAML
  108. compile 'com.github.bmoliveira:snake-yaml:v1.18-android'
  109. // JavaScript engine
  110. compile 'com.squareup.duktape:duktape-android:1.0.0'
  111. // Disk cache
  112. compile 'com.jakewharton:disklrucache:2.0.2'
  113. // Parse HTML
  114. compile 'org.jsoup:jsoup:1.9.2'
  115. // Changelog
  116. compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
  117. // Database
  118. compile "com.pushtorefresh.storio:sqlite:1.11.0"
  119. // Model View Presenter
  120. final nucleus_version = '3.0.0'
  121. compile "info.android15.nucleus:nucleus:$nucleus_version"
  122. compile "info.android15.nucleus:nucleus-support-v4:$nucleus_version"
  123. compile "info.android15.nucleus:nucleus-support-v7:$nucleus_version"
  124. // Dependency injection
  125. compile "uy.kohesive.injekt:injekt-core:1.16.1"
  126. // Image library
  127. compile 'com.github.bumptech.glide:glide:3.7.0'
  128. compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar'
  129. // Transformations
  130. compile 'jp.wasabeef:glide-transformations:2.0.1'
  131. // Logging
  132. compile 'com.jakewharton.timber:timber:4.3.1'
  133. // Crash reports
  134. compile 'ch.acra:acra:4.9.1'
  135. // UI
  136. compile 'com.dmitrymalkovich.android:material-design-dimens:1.4'
  137. compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
  138. compile 'eu.davidea:flexible-adapter:4.2.0'
  139. compile 'com.nononsenseapps:filepicker:2.5.2'
  140. compile 'com.github.amulyakhare:TextDrawable:558677e'
  141. compile 'com.afollestad.material-dialogs:core:0.9.0.2'
  142. compile 'net.xpece.android:support-preference:1.0.3'
  143. compile 'me.zhanghai.android.systemuihelper:library:1.0.0'
  144. compile 'de.hdodenhof:circleimageview:2.1.0'
  145. // Tests
  146. testCompile 'junit:junit:4.12'
  147. testCompile 'org.assertj:assertj-core:1.7.1'
  148. testCompile 'org.mockito:mockito-core:1.10.19'
  149. testCompile 'org.robolectric:robolectric:3.1.2'
  150. testCompile 'org.robolectric:shadows-multidex:3.1.2'
  151. testCompile 'org.robolectric:shadows-play-services:3.1.2'
  152. compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  153. }
  154. buildscript {
  155. ext.kotlin_version = '1.0.4'
  156. repositories {
  157. mavenCentral()
  158. }
  159. dependencies {
  160. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  161. }
  162. }
  163. repositories {
  164. mavenCentral()
  165. }