build.gradle 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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 7
  35. versionCode project.findProperty('versionCode')?.toInteger() ?: 7
  36. versionName "0.2.1"
  37. buildConfigField "String", "COMMIT_COUNT", "\"${getCommitCount()}\""
  38. buildConfigField "String", "COMMIT_SHA", "\"${getGitSha()}\""
  39. buildConfigField "String", "BUILD_TIME", "\"${getBuildTime()}\""
  40. buildConfigField "boolean", "INCLUDE_UPDATER", "${includeUpdater()}"
  41. vectorDrawables.useSupportLibrary = true
  42. }
  43. buildTypes {
  44. debug {
  45. versionNameSuffix ".${getCommitCount()}"
  46. applicationIdSuffix ".debug"
  47. }
  48. release {
  49. minifyEnabled true
  50. shrinkResources true
  51. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  52. }
  53. }
  54. packagingOptions {
  55. exclude 'META-INF/DEPENDENCIES'
  56. exclude 'LICENSE.txt'
  57. exclude 'META-INF/LICENSE'
  58. exclude 'META-INF/LICENSE.txt'
  59. exclude 'META-INF/NOTICE'
  60. }
  61. lintOptions {
  62. abortOnError false
  63. checkReleaseBuilds false
  64. }
  65. sourceSets {
  66. main.java.srcDirs += 'src/main/kotlin'
  67. }
  68. // http://stackoverflow.com/questions/32759529/androidhttpclient-not-found-when-running-robolectric
  69. useLibrary 'org.apache.http.legacy'
  70. }
  71. kapt {
  72. generateStubs = true
  73. }
  74. dependencies {
  75. final SUPPORT_LIBRARY_VERSION = '23.4.0'
  76. final DAGGER_VERSION = '2.4'
  77. final RETROFIT_VERSION = '2.0.2'
  78. final NUCLEUS_VERSION = '3.0.0'
  79. final STORIO_VERSION = '1.8.0'
  80. final MOCKITO_VERSION = '1.10.19'
  81. // Modified dependencies
  82. compile 'com.github.inorichi:subsampling-scale-image-view:421fb81'
  83. compile 'com.github.inorichi:ReactiveNetwork:69092ed'
  84. // Android support library
  85. compile "com.android.support:support-v4:$SUPPORT_LIBRARY_VERSION"
  86. compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
  87. compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION"
  88. compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION"
  89. compile "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION"
  90. compile "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION"
  91. compile "com.android.support:preference-v7:$SUPPORT_LIBRARY_VERSION"
  92. compile "com.android.support:preference-v14:$SUPPORT_LIBRARY_VERSION"
  93. compile "com.android.support:customtabs:$SUPPORT_LIBRARY_VERSION"
  94. // ReactiveX
  95. compile 'io.reactivex:rxandroid:1.2.0'
  96. compile 'io.reactivex:rxjava:1.1.5'
  97. compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.1'
  98. // Network client
  99. compile "com.squareup.okhttp3:okhttp:3.3.1"
  100. // REST
  101. compile "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION"
  102. compile "com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION"
  103. compile "com.squareup.retrofit2:adapter-rxjava:$RETROFIT_VERSION"
  104. // IO
  105. compile 'com.squareup.okio:okio:1.8.0'
  106. // JSON
  107. compile 'com.google.code.gson:gson:2.6.2'
  108. // YAML
  109. compile 'org.yaml:snakeyaml:1.17'
  110. // JavaScript engine
  111. compile 'com.squareup.duktape:duktape-android:0.9.5'
  112. // Disk cache
  113. compile 'com.jakewharton:disklrucache:2.0.2'
  114. // Parse HTML
  115. compile 'org.jsoup:jsoup:1.9.2'
  116. // Changelog
  117. compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
  118. // Database
  119. compile "com.pushtorefresh.storio:sqlite:$STORIO_VERSION"
  120. compile "com.pushtorefresh.storio:sqlite-annotations:$STORIO_VERSION"
  121. kapt "com.pushtorefresh.storio:sqlite-annotations-processor:$STORIO_VERSION"
  122. // Model View Presenter
  123. compile "info.android15.nucleus:nucleus:$NUCLEUS_VERSION"
  124. compile "info.android15.nucleus:nucleus-support-v4:$NUCLEUS_VERSION"
  125. compile "info.android15.nucleus:nucleus-support-v7:$NUCLEUS_VERSION"
  126. // Dependency injection
  127. compile "com.google.dagger:dagger:$DAGGER_VERSION"
  128. kapt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
  129. provided 'org.glassfish:javax.annotation:10.0-b28'
  130. // Image library
  131. compile 'com.github.bumptech.glide:glide:3.7.0'
  132. compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar'
  133. // Logging
  134. compile 'com.jakewharton.timber:timber:4.1.2'
  135. // Crash reports
  136. compile 'ch.acra:acra:4.8.5'
  137. // UI
  138. compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
  139. compile 'eu.davidea:flexible-adapter:4.2.0'
  140. compile 'com.nononsenseapps:filepicker:2.5.2'
  141. compile 'com.github.amulyakhare:TextDrawable:558677e'
  142. compile 'com.afollestad.material-dialogs:core:0.8.5.9'
  143. // Tests
  144. testCompile 'junit:junit:4.12'
  145. testCompile 'org.assertj:assertj-core:1.7.1'
  146. testCompile "org.mockito:mockito-core:$MOCKITO_VERSION"
  147. testCompile('org.robolectric:robolectric:3.0') {
  148. exclude group: 'commons-logging', module: 'commons-logging'
  149. exclude group: 'org.apache.httpcomponents', module: 'httpclient'
  150. }
  151. kaptTest "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
  152. compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  153. }
  154. buildscript {
  155. ext.kotlin_version = '1.0.2'
  156. repositories {
  157. mavenCentral()
  158. }
  159. dependencies {
  160. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  161. }
  162. }
  163. repositories {
  164. mavenCentral()
  165. }