build.gradle 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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 origin/master'.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.2"
  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 5
  35. versionName "0.1.4"
  36. buildConfigField "String", "COMMIT_COUNT", "\"${getCommitCount()}\""
  37. buildConfigField "String", "COMMIT_SHA", "\"${getGitSha()}\""
  38. buildConfigField "String", "BUILD_TIME", "\"${getBuildTime()}\""
  39. buildConfigField "boolean", "INCLUDE_UPDATER", "${includeUpdater()}"
  40. vectorDrawables.useSupportLibrary = true
  41. }
  42. buildTypes {
  43. debug {
  44. versionNameSuffix ".${getCommitCount()}"
  45. applicationIdSuffix ".debug"
  46. }
  47. release {
  48. minifyEnabled true
  49. shrinkResources true
  50. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  51. }
  52. }
  53. packagingOptions {
  54. exclude 'META-INF/DEPENDENCIES'
  55. exclude 'LICENSE.txt'
  56. exclude 'META-INF/LICENSE'
  57. exclude 'META-INF/LICENSE.txt'
  58. exclude 'META-INF/NOTICE'
  59. }
  60. lintOptions {
  61. abortOnError false
  62. checkReleaseBuilds false
  63. }
  64. sourceSets {
  65. main.java.srcDirs += 'src/main/kotlin'
  66. }
  67. // http://stackoverflow.com/questions/32759529/androidhttpclient-not-found-when-running-robolectric
  68. useLibrary 'org.apache.http.legacy'
  69. }
  70. kapt {
  71. generateStubs = true
  72. }
  73. dependencies {
  74. final SUPPORT_LIBRARY_VERSION = '23.2.1'
  75. final DAGGER_VERSION = '2.2'
  76. final OKHTTP_VERSION = '3.2.0'
  77. final RETROFIT_VERSION = '2.0.1'
  78. final STORIO_VERSION = '1.8.0'
  79. final MOCKITO_VERSION = '1.10.19'
  80. compile fileTree(dir: 'libs', include: ['*.jar'])
  81. compile project(":SubsamplingScaleImageView")
  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:percent:$SUPPORT_LIBRARY_VERSION"
  89. compile "com.android.support:preference-v7:$SUPPORT_LIBRARY_VERSION"
  90. compile "com.android.support:preference-v14:$SUPPORT_LIBRARY_VERSION"
  91. compile "com.squareup.okhttp3:okhttp:$OKHTTP_VERSION"
  92. compile "com.squareup.okhttp3:okhttp-urlconnection:$OKHTTP_VERSION"
  93. compile 'com.squareup.okio:okio:1.6.0'
  94. compile "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION"
  95. compile "com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION"
  96. compile "com.squareup.retrofit2:adapter-rxjava:$RETROFIT_VERSION"
  97. compile 'com.jakewharton:disklrucache:2.0.2'
  98. compile 'com.google.code.gson:gson:2.6.2'
  99. compile 'org.jsoup:jsoup:1.8.3'
  100. compile 'io.reactivex:rxandroid:1.1.0'
  101. compile 'io.reactivex:rxjava:1.1.1'
  102. compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.1'
  103. compile "com.pushtorefresh.storio:sqlite:$STORIO_VERSION"
  104. compile "com.pushtorefresh.storio:sqlite-annotations:$STORIO_VERSION"
  105. compile 'info.android15.nucleus:nucleus:2.0.5'
  106. compile 'com.github.bumptech.glide:glide:3.7.0'
  107. compile 'com.jakewharton.timber:timber:4.1.2'
  108. compile 'ch.acra:acra:4.8.5'
  109. compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
  110. compile 'eu.davidea:flexible-adapter:4.2.0'
  111. compile 'com.nononsenseapps:filepicker:2.5.2'
  112. compile 'com.github.amulyakhare:TextDrawable:558677e'
  113. compile "com.google.dagger:dagger:$DAGGER_VERSION"
  114. kapt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
  115. kapt "com.pushtorefresh.storio:sqlite-annotations-processor:$STORIO_VERSION"
  116. provided 'org.glassfish:javax.annotation:10.0-b28'
  117. compile('com.github.afollestad.material-dialogs:core:0.8.5.5@aar') {
  118. transitive = true
  119. }
  120. testCompile 'junit:junit:4.12'
  121. testCompile 'org.assertj:assertj-core:1.7.1'
  122. testCompile "org.mockito:mockito-core:$MOCKITO_VERSION"
  123. testCompile('org.robolectric:robolectric:3.0') {
  124. exclude group: 'commons-logging', module: 'commons-logging'
  125. exclude group: 'org.apache.httpcomponents', module: 'httpclient'
  126. }
  127. kaptTest "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
  128. compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  129. }
  130. buildscript {
  131. ext.kotlin_version = '1.0.1'
  132. repositories {
  133. mavenCentral()
  134. }
  135. dependencies {
  136. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  137. }
  138. }
  139. repositories {
  140. mavenCentral()
  141. }