build.gradle 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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 OKHTTP_VERSION = '3.2.0'
  78. final RETROFIT_VERSION = '2.0.2'
  79. final NUCLEUS_VERSION = '3.0.0'
  80. final STORIO_VERSION = '1.8.0'
  81. final MOCKITO_VERSION = '1.10.19'
  82. // Modified dependencies
  83. compile 'com.github.inorichi:subsampling-scale-image-view:421fb81'
  84. compile 'com.github.inorichi:ReactiveNetwork:69092ed'
  85. // Android support library
  86. compile "com.android.support:support-v4:$SUPPORT_LIBRARY_VERSION"
  87. compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
  88. compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION"
  89. compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION"
  90. compile "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION"
  91. compile "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION"
  92. compile "com.android.support:preference-v7:$SUPPORT_LIBRARY_VERSION"
  93. compile "com.android.support:preference-v14:$SUPPORT_LIBRARY_VERSION"
  94. compile "com.android.support:customtabs:$SUPPORT_LIBRARY_VERSION"
  95. // ReactiveX
  96. compile 'io.reactivex:rxandroid:1.2.0'
  97. compile 'io.reactivex:rxjava:1.1.5'
  98. compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.1'
  99. // Network client
  100. compile "com.squareup.okhttp3:okhttp:$OKHTTP_VERSION"
  101. // REST
  102. compile "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION"
  103. compile "com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION"
  104. compile "com.squareup.retrofit2:adapter-rxjava:$RETROFIT_VERSION"
  105. // IO
  106. compile 'com.squareup.okio:okio:1.8.0'
  107. // JSON
  108. compile 'com.google.code.gson:gson:2.6.2'
  109. // YAML
  110. compile 'org.yaml:snakeyaml:1.17'
  111. // JavaScript engine
  112. compile 'com.squareup.duktape:duktape-android:0.9.5'
  113. // Disk cache
  114. compile 'com.jakewharton:disklrucache:2.0.2'
  115. // Parse HTML
  116. compile 'org.jsoup:jsoup:1.9.1'
  117. // Changelog
  118. compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
  119. // Database
  120. compile "com.pushtorefresh.storio:sqlite:$STORIO_VERSION"
  121. compile "com.pushtorefresh.storio:sqlite-annotations:$STORIO_VERSION"
  122. kapt "com.pushtorefresh.storio:sqlite-annotations-processor:$STORIO_VERSION"
  123. // Model View Presenter
  124. compile "info.android15.nucleus:nucleus:$NUCLEUS_VERSION"
  125. compile "info.android15.nucleus:nucleus-support-v4:$NUCLEUS_VERSION"
  126. compile "info.android15.nucleus:nucleus-support-v7:$NUCLEUS_VERSION"
  127. // Dependency injection
  128. compile "com.google.dagger:dagger:$DAGGER_VERSION"
  129. kapt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
  130. provided 'org.glassfish:javax.annotation:10.0-b28'
  131. // Image library
  132. compile 'com.github.bumptech.glide:glide:3.7.0'
  133. compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar'
  134. // Logging
  135. compile 'com.jakewharton.timber:timber:4.1.2'
  136. // Crash reports
  137. compile 'ch.acra:acra:4.8.5'
  138. // UI
  139. compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
  140. compile 'eu.davidea:flexible-adapter:4.2.0'
  141. compile 'com.nononsenseapps:filepicker:2.5.2'
  142. compile 'com.github.amulyakhare:TextDrawable:558677e'
  143. compile('com.github.afollestad.material-dialogs:core:0.8.5.5@aar') {
  144. transitive = true
  145. }
  146. // Tests
  147. testCompile 'junit:junit:4.12'
  148. testCompile 'org.assertj:assertj-core:1.7.1'
  149. testCompile "org.mockito:mockito-core:$MOCKITO_VERSION"
  150. testCompile('org.robolectric:robolectric:3.0') {
  151. exclude group: 'commons-logging', module: 'commons-logging'
  152. exclude group: 'org.apache.httpcomponents', module: 'httpclient'
  153. }
  154. kaptTest "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
  155. compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  156. }
  157. buildscript {
  158. ext.kotlin_version = '1.0.2'
  159. repositories {
  160. mavenCentral()
  161. }
  162. dependencies {
  163. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  164. }
  165. }
  166. repositories {
  167. mavenCentral()
  168. }