build.gradle 5.7 KB

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