build.gradle 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'kotlin-android'
  3. apply plugin: 'kotlin-android-extensions'
  4. apply plugin: 'kotlin-kapt'
  5. def getGitSha = { ->
  6. def stdout = new ByteArrayOutputStream()
  7. exec {
  8. commandLine 'git', 'rev-parse', '--short', 'HEAD'
  9. standardOutput = stdout
  10. }
  11. return stdout.toString().trim()
  12. }
  13. android {
  14. compileSdkVersion 28
  15. defaultConfig {
  16. applicationId "com.keylesspalace.tusky"
  17. minSdkVersion 21
  18. targetSdkVersion 28
  19. versionCode 62
  20. versionName "7.1"
  21. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  22. vectorDrawables.useSupportLibrary = true
  23. kapt {
  24. arguments {
  25. arg("room.schemaLocation", "$projectDir/schemas")
  26. }
  27. }
  28. }
  29. buildTypes {
  30. release {
  31. minifyEnabled true
  32. shrinkResources true
  33. proguardFiles 'proguard-rules.pro'
  34. }
  35. debug {}
  36. }
  37. flavorDimensions "color"
  38. productFlavors {
  39. blue {}
  40. green {
  41. applicationIdSuffix ".test"
  42. versionNameSuffix "-" + getGitSha()
  43. }
  44. }
  45. lintOptions {
  46. disable 'MissingTranslation'
  47. }
  48. compileOptions {
  49. sourceCompatibility JavaVersion.VERSION_1_8
  50. targetCompatibility JavaVersion.VERSION_1_8
  51. }
  52. androidExtensions {
  53. experimental = true
  54. }
  55. testOptions {
  56. unitTests {
  57. includeAndroidResources = true
  58. }
  59. }
  60. sourceSets {
  61. androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
  62. }
  63. packagingOptions {
  64. // Exclude unneeded files added by libraries
  65. exclude 'LICENSE_OFL'
  66. exclude 'LICENSE_UNICODE'
  67. }
  68. bundle {
  69. language {
  70. // bundle all languages in every apk so the dynamic language switching works
  71. enableSplit = false
  72. }
  73. }
  74. }
  75. project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
  76. kotlinOptions {
  77. jvmTarget = "1.8"
  78. }
  79. }
  80. ext.daggerVersion = '2.23.1'
  81. ext.retrofitVersion = '2.6.0'
  82. // if libraries are changed here, they should also be changed in LicenseActivity
  83. dependencies {
  84. implementation('com.mikepenz:materialdrawer:6.1.2@aar') {
  85. transitive = true
  86. }
  87. implementation 'androidx.core:core:1.0.2'
  88. implementation 'androidx.appcompat:appcompat:1.0.2'
  89. implementation 'androidx.browser:browser:1.0.0'
  90. implementation 'androidx.recyclerview:recyclerview:1.0.0'
  91. implementation 'androidx.legacy:legacy-support-v13:1.0.0'
  92. implementation 'com.google.android.material:material:1.1.0-alpha05'
  93. implementation 'androidx.exifinterface:exifinterface:1.0.0'
  94. implementation 'androidx.cardview:cardview:1.0.0'
  95. implementation 'androidx.preference:preference:1.1.0-alpha04'
  96. implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
  97. implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
  98. implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
  99. implementation 'com.squareup.okhttp3:okhttp:3.14.2'
  100. implementation 'com.squareup.okhttp3:logging-interceptor:3.14.2'
  101. implementation 'org.conscrypt:conscrypt-android:2.1.0'
  102. implementation 'com.github.connyduck:sparkbutton:2.0.0'
  103. implementation 'com.github.chrisbanes:PhotoView:2.3.0'
  104. implementation 'com.mikepenz:google-material-typeface:3.0.1.3.original@aar'
  105. implementation('com.theartofdev.edmodo:android-image-cropper:2.8.0') {
  106. exclude group: 'com.android.support'
  107. }
  108. implementation 'com.evernote:android-job:1.2.6'
  109. implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  110. // EmojiCompat
  111. implementation 'androidx.emoji:emoji:1.0.0'
  112. implementation 'androidx.emoji:emoji-appcompat:1.0.0'
  113. implementation 'de.c1710:filemojicompat:1.0.17'
  114. // architecture components
  115. implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
  116. //room
  117. implementation 'androidx.room:room-runtime:2.1.0'
  118. implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  119. kapt 'androidx.room:room-compiler:2.1.0'
  120. implementation 'androidx.room:room-rxjava2:2.1.0'
  121. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
  122. implementation "com.google.dagger:dagger:$daggerVersion"
  123. kapt "com.google.dagger:dagger-compiler:$daggerVersion"
  124. implementation "com.google.dagger:dagger-android:$daggerVersion"
  125. implementation "com.google.dagger:dagger-android-support:$daggerVersion"
  126. kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
  127. testImplementation 'org.robolectric:robolectric:4.3'
  128. testImplementation 'org.mockito:mockito-inline:2.28.2'
  129. testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0'
  130. androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1', {
  131. exclude group: 'com.android.support', module: 'support-annotations'
  132. })
  133. androidTestImplementation 'android.arch.persistence.room:testing:1.1.1'
  134. androidTestImplementation 'androidx.test.ext:junit:1.1.1'
  135. testImplementation 'androidx.test.ext:junit:1.1.1'
  136. debugImplementation 'im.dino:dbinspector:3.4.1@aar'
  137. implementation 'io.reactivex.rxjava2:rxjava:2.2.9'
  138. implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
  139. implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0'
  140. implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.3.0'
  141. implementation 'com.uber.autodispose:autodispose:1.3.0'
  142. implementation 'androidx.paging:paging-runtime-ktx:2.1.0'
  143. //Glide
  144. implementation 'com.github.bumptech.glide:glide:4.9.0'
  145. implementation 'com.github.bumptech.glide:okhttp3-integration:4.9.0'
  146. //Add some useful extensions
  147. implementation 'androidx.core:core-ktx:1.2.0-alpha01'
  148. }