build.gradle 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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. vectorDrawables.useSupportLibrary = true
  46. }
  47. compileOptions {
  48. sourceCompatibility JavaVersion.VERSION_1_8
  49. targetCompatibility JavaVersion.VERSION_1_8
  50. }
  51. buildTypes {
  52. debug {
  53. applicationIdSuffix ".debug"
  54. }
  55. release {
  56. minifyEnabled true
  57. shrinkResources true
  58. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  59. }
  60. }
  61. packagingOptions {
  62. exclude 'META-INF/DEPENDENCIES'
  63. exclude 'LICENSE.txt'
  64. exclude 'META-INF/LICENSE'
  65. exclude 'META-INF/LICENSE.txt'
  66. exclude 'META-INF/NOTICE'
  67. }
  68. lintOptions {
  69. abortOnError false
  70. checkReleaseBuilds false
  71. }
  72. sourceSets {
  73. main.java.srcDirs += 'src/main/kotlin'
  74. }
  75. // http://stackoverflow.com/questions/32759529/androidhttpclient-not-found-when-running-robolectric
  76. useLibrary 'org.apache.http.legacy'
  77. }
  78. apt {
  79. arguments {
  80. eventBusIndex "eu.kanade.tachiyomi.EventBusIndex"
  81. }
  82. }
  83. dependencies {
  84. final SUPPORT_LIBRARY_VERSION = '23.2.0'
  85. final DAGGER_VERSION = '2.0.2'
  86. final OKHTTP_VERSION = '3.2.0'
  87. final RETROFIT_VERSION = '2.0.0-beta4'
  88. final STORIO_VERSION = '1.8.0'
  89. final ICEPICK_VERSION = '3.2.0'
  90. final MOCKITO_VERSION = '1.10.19'
  91. compile fileTree(dir: 'libs', include: ['*.jar'])
  92. compile project(":SubsamplingScaleImageView")
  93. compile "com.android.support:support-v4:$SUPPORT_LIBRARY_VERSION"
  94. compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
  95. compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION"
  96. compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION"
  97. compile "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION"
  98. compile "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION"
  99. compile "com.android.support:percent:$SUPPORT_LIBRARY_VERSION"
  100. compile "com.squareup.okhttp3:okhttp:$OKHTTP_VERSION"
  101. compile "com.squareup.okhttp3:okhttp-urlconnection:$OKHTTP_VERSION"
  102. compile 'com.squareup.okio:okio:1.6.0'
  103. compile 'com.google.code.gson:gson:2.6.1'
  104. compile 'com.jakewharton:disklrucache:2.0.2'
  105. compile 'org.jsoup:jsoup:1.8.3'
  106. compile 'io.reactivex:rxandroid:1.1.0'
  107. compile 'io.reactivex:rxjava:1.1.1'
  108. compile "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION"
  109. compile "com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION"
  110. compile "com.squareup.retrofit2:adapter-rxjava:$RETROFIT_VERSION"
  111. compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.1'
  112. compile "com.pushtorefresh.storio:sqlite:$STORIO_VERSION"
  113. compile "com.pushtorefresh.storio:sqlite-annotations:$STORIO_VERSION"
  114. compile 'info.android15.nucleus:nucleus:2.0.5'
  115. compile 'com.github.bumptech.glide:glide:3.7.0'
  116. compile 'com.jakewharton:butterknife:7.0.1'
  117. compile 'com.jakewharton.timber:timber:4.1.1'
  118. compile 'ch.acra:acra:4.8.2'
  119. compile "frankiesardo:icepick:$ICEPICK_VERSION"
  120. provided "frankiesardo:icepick-processor:$ICEPICK_VERSION"
  121. compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
  122. compile 'eu.davidea:flexible-adapter:4.2.0'
  123. compile 'com.nononsenseapps:filepicker:2.5.2'
  124. compile 'com.github.amulyakhare:TextDrawable:558677e'
  125. compile "org.greenrobot:eventbus:3.0.0"
  126. apt "org.greenrobot:eventbus-annotation-processor:3.0.1"
  127. compile "com.google.dagger:dagger:$DAGGER_VERSION"
  128. apt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
  129. apt "com.pushtorefresh.storio:sqlite-annotations-processor:$STORIO_VERSION"
  130. provided 'org.glassfish:javax.annotation:10.0-b28'
  131. compile('com.mikepenz:materialdrawer:4.6.4@aar') {
  132. transitive = true
  133. }
  134. compile('com.github.afollestad.material-dialogs:core:0.8.5.6@aar') {
  135. transitive = true
  136. }
  137. testCompile 'junit:junit:4.12'
  138. testCompile 'org.assertj:assertj-core:2.3.0'
  139. testCompile "org.mockito:mockito-core:$MOCKITO_VERSION"
  140. testCompile('org.robolectric:robolectric:3.0') {
  141. exclude group: 'commons-logging', module: 'commons-logging'
  142. exclude group: 'org.apache.httpcomponents', module: 'httpclient'
  143. }
  144. androidTestApt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
  145. compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  146. }
  147. buildscript {
  148. ext.kotlin_version = '1.0.0'
  149. repositories {
  150. mavenCentral()
  151. }
  152. dependencies {
  153. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  154. }
  155. }
  156. repositories {
  157. mavenCentral()
  158. }