build.gradle 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. import java.text.SimpleDateFormat
  2. apply plugin: 'com.android.application'
  3. apply plugin: 'kotlin-android'
  4. apply plugin: 'kotlin-android-extensions'
  5. apply plugin: 'com.neenbedankt.android-apt'
  6. apply plugin: 'me.tatarka.retrolambda'
  7. retrolambda {
  8. jvmArgs '-noverify'
  9. }
  10. ext {
  11. // Git is needed in your system PATH for these commands to work.
  12. // If it's not installed, you can return a random value as a workaround
  13. getCommitCount = {
  14. return 'git rev-list --count origin/master'.execute().text.trim()
  15. // return "1"
  16. }
  17. getGitSha = {
  18. return 'git rev-parse --short HEAD'.execute().text.trim()
  19. // return "1"
  20. }
  21. getBuildTime = {
  22. def df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'")
  23. df.setTimeZone(TimeZone.getTimeZone("UTC"))
  24. return df.format(new Date())
  25. }
  26. }
  27. def includeUpdater() {
  28. return hasProperty("include_updater");
  29. }
  30. android {
  31. compileSdkVersion 23
  32. buildToolsVersion "23.0.2"
  33. publishNonDefault true
  34. defaultConfig {
  35. applicationId "eu.kanade.tachiyomi"
  36. minSdkVersion 16
  37. targetSdkVersion 23
  38. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  39. versionCode 5
  40. versionName "0.1.4"
  41. buildConfigField "String", "COMMIT_COUNT", "\"${getCommitCount()}\""
  42. buildConfigField "String", "COMMIT_SHA", "\"${getGitSha()}\""
  43. buildConfigField "String", "BUILD_TIME", "\"${getBuildTime()}\""
  44. buildConfigField "boolean", "INCLUDE_UPDATER", "${includeUpdater()}"
  45. }
  46. compileOptions {
  47. sourceCompatibility JavaVersion.VERSION_1_8
  48. targetCompatibility JavaVersion.VERSION_1_8
  49. }
  50. buildTypes {
  51. debug {
  52. applicationIdSuffix ".debug"
  53. }
  54. release {
  55. minifyEnabled true
  56. shrinkResources true
  57. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  58. }
  59. }
  60. packagingOptions {
  61. exclude 'META-INF/DEPENDENCIES'
  62. exclude 'LICENSE.txt'
  63. exclude 'META-INF/LICENSE'
  64. exclude 'META-INF/LICENSE.txt'
  65. exclude 'META-INF/NOTICE'
  66. }
  67. lintOptions {
  68. abortOnError false
  69. checkReleaseBuilds false
  70. }
  71. sourceSets {
  72. main.java.srcDirs += 'src/main/kotlin'
  73. }
  74. // http://stackoverflow.com/questions/32759529/androidhttpclient-not-found-when-running-robolectric
  75. useLibrary 'org.apache.http.legacy'
  76. }
  77. apt {
  78. arguments {
  79. eventBusIndex "eu.kanade.tachiyomi.EventBusIndex"
  80. }
  81. }
  82. dependencies {
  83. final SUPPORT_LIBRARY_VERSION = '23.2.0'
  84. final DAGGER_VERSION = '2.0.2'
  85. final OKHTTP_VERSION = '3.2.0'
  86. final RETROFIT_VERSION = '2.0.0-beta4'
  87. final STORIO_VERSION = '1.8.0'
  88. final ICEPICK_VERSION = '3.2.0'
  89. final MOCKITO_VERSION = '1.10.19'
  90. compile fileTree(dir: 'libs', include: ['*.jar'])
  91. compile project(":SubsamplingScaleImageView")
  92. compile "com.android.support:support-v4:$SUPPORT_LIBRARY_VERSION"
  93. compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
  94. compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION"
  95. compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION"
  96. compile "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION"
  97. compile "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION"
  98. compile "com.android.support:percent:$SUPPORT_LIBRARY_VERSION"
  99. compile "com.squareup.okhttp3:okhttp:$OKHTTP_VERSION"
  100. compile "com.squareup.okhttp3:okhttp-urlconnection:$OKHTTP_VERSION"
  101. compile 'com.squareup.okio:okio:1.6.0'
  102. compile 'com.google.code.gson:gson:2.6.1'
  103. compile 'com.jakewharton:disklrucache:2.0.2'
  104. compile 'org.jsoup:jsoup:1.8.3'
  105. compile 'io.reactivex:rxandroid:1.1.0'
  106. compile 'io.reactivex:rxjava:1.1.1'
  107. compile "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION"
  108. compile "com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION"
  109. compile "com.squareup.retrofit2:adapter-rxjava:$RETROFIT_VERSION"
  110. compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.1'
  111. compile "com.pushtorefresh.storio:sqlite:$STORIO_VERSION"
  112. compile "com.pushtorefresh.storio:sqlite-annotations:$STORIO_VERSION"
  113. compile 'info.android15.nucleus:nucleus:2.0.5'
  114. compile 'com.github.bumptech.glide:glide:3.7.0'
  115. compile 'com.jakewharton:butterknife:7.0.1'
  116. compile 'com.jakewharton.timber:timber:4.1.1'
  117. compile 'ch.acra:acra:4.8.2'
  118. compile "frankiesardo:icepick:$ICEPICK_VERSION"
  119. provided "frankiesardo:icepick-processor:$ICEPICK_VERSION"
  120. compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
  121. compile 'eu.davidea:flexible-adapter:4.2.0'
  122. compile 'com.nononsenseapps:filepicker:2.5.2'
  123. compile 'com.github.amulyakhare:TextDrawable:558677e'
  124. compile "org.greenrobot:eventbus:3.0.0"
  125. apt "org.greenrobot:eventbus-annotation-processor:3.0.1"
  126. compile "com.google.dagger:dagger:$DAGGER_VERSION"
  127. apt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
  128. apt "com.pushtorefresh.storio:sqlite-annotations-processor:$STORIO_VERSION"
  129. provided 'org.glassfish:javax.annotation:10.0-b28'
  130. compile('com.mikepenz:materialdrawer:4.6.4@aar') {
  131. transitive = true
  132. }
  133. // Google material icons SVG.
  134. compile 'com.mikepenz:google-material-typeface:2.1.0.1.original@aar'
  135. compile('com.github.afollestad.material-dialogs:core:0.8.5.6@aar') {
  136. transitive = true
  137. }
  138. testCompile 'junit:junit:4.12'
  139. testCompile 'org.assertj:assertj-core:2.3.0'
  140. testCompile "org.mockito:mockito-core:$MOCKITO_VERSION"
  141. testCompile('org.robolectric:robolectric:3.0') {
  142. exclude group: 'commons-logging', module: 'commons-logging'
  143. exclude group: 'org.apache.httpcomponents', module: 'httpclient'
  144. }
  145. androidTestApt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
  146. compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  147. }
  148. buildscript {
  149. ext.kotlin_version = '1.0.0'
  150. repositories {
  151. mavenCentral()
  152. }
  153. dependencies {
  154. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  155. }
  156. }
  157. repositories {
  158. mavenCentral()
  159. }