build.gradle 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. plugins {
  2. alias(libs.plugins.android.application)
  3. alias(libs.plugins.kotlin.android)
  4. alias(libs.plugins.kotlin.kapt)
  5. alias(libs.plugins.kotlin.parcelize)
  6. }
  7. apply from: 'getGitSha.gradle'
  8. final def gitSha = ext.getGitSha()
  9. // The app name
  10. final def APP_NAME = "Tusky"
  11. // The application id. Must be unique, e.g. based on your domain
  12. final def APP_ID = "com.keylesspalace.tusky"
  13. // url of a custom app logo. Recommended size at least 600x600. Keep empty to use the Tusky elephant friend.
  14. final def CUSTOM_LOGO_URL = ""
  15. // e.g. mastodon.social. Keep empty to not suggest any instance on the signup screen
  16. final def CUSTOM_INSTANCE = ""
  17. // link to your support account. Will be linked on the about page when not empty.
  18. final def SUPPORT_ACCOUNT_URL = "https://mastodon.social/@Tusky"
  19. android {
  20. compileSdk 33
  21. namespace "com.keylesspalace.tusky"
  22. defaultConfig {
  23. applicationId APP_ID
  24. namespace "com.keylesspalace.tusky"
  25. minSdk 23
  26. targetSdk 33
  27. versionCode 100
  28. versionName "21.0"
  29. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  30. vectorDrawables.useSupportLibrary = true
  31. resValue "string", "app_name", APP_NAME
  32. buildConfigField("String", "CUSTOM_LOGO_URL", "\"$CUSTOM_LOGO_URL\"")
  33. buildConfigField("String", "CUSTOM_INSTANCE", "\"$CUSTOM_INSTANCE\"")
  34. buildConfigField("String", "SUPPORT_ACCOUNT_URL", "\"$SUPPORT_ACCOUNT_URL\"")
  35. }
  36. buildTypes {
  37. release {
  38. minifyEnabled true
  39. shrinkResources true
  40. proguardFiles 'proguard-rules.pro'
  41. }
  42. }
  43. flavorDimensions += "color"
  44. productFlavors {
  45. blue {}
  46. green {
  47. resValue "string", "app_name", APP_NAME + " Test"
  48. applicationIdSuffix ".test"
  49. versionNameSuffix "-" + gitSha
  50. }
  51. }
  52. lint {
  53. disable 'MissingTranslation'
  54. }
  55. buildFeatures {
  56. buildConfig true
  57. resValues true
  58. viewBinding true
  59. }
  60. testOptions {
  61. unitTests {
  62. returnDefaultValues = true
  63. includeAndroidResources = true
  64. }
  65. unitTests.all {
  66. systemProperty 'robolectric.logging.enabled', 'true'
  67. systemProperty 'robolectric.lazyload', 'ON'
  68. }
  69. }
  70. sourceSets {
  71. androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
  72. }
  73. // Exclude unneeded files added by libraries
  74. packagingOptions.resources.excludes += [
  75. 'LICENSE_OFL',
  76. 'LICENSE_UNICODE',
  77. ]
  78. bundle {
  79. language {
  80. // bundle all languages in every apk so the dynamic language switching works
  81. enableSplit = false
  82. }
  83. }
  84. dependenciesInfo {
  85. includeInApk false
  86. includeInBundle false
  87. }
  88. // Can remove this once https://issuetracker.google.com/issues/260059413 is fixed.
  89. // https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support
  90. compileOptions {
  91. sourceCompatibility JavaVersion.VERSION_11
  92. targetCompatibility JavaVersion.VERSION_11
  93. }
  94. applicationVariants.configureEach { variant ->
  95. variant.outputs.configureEach {
  96. outputFileName = "Tusky_${variant.versionName}_${variant.versionCode}_${gitSha}_" +
  97. "${variant.flavorName}_${buildType.name}.apk"
  98. }
  99. }
  100. }
  101. kapt {
  102. arguments {
  103. arg("room.schemaLocation", "$projectDir/schemas")
  104. arg("room.incremental", "true")
  105. }
  106. }
  107. // library versions are in PROJECT_ROOT/gradle/libs.versions.toml
  108. dependencies {
  109. implementation libs.kotlinx.coroutines.android
  110. implementation libs.kotlinx.coroutines.rx3
  111. implementation libs.bundles.androidx
  112. implementation libs.bundles.room
  113. kapt libs.androidx.room.compiler
  114. implementation libs.android.material
  115. implementation libs.gson
  116. implementation libs.bundles.retrofit
  117. implementation libs.networkresult.calladapter
  118. implementation libs.bundles.okhttp
  119. implementation libs.conscrypt.android
  120. implementation libs.bundles.glide
  121. kapt libs.glide.compiler
  122. implementation libs.bundles.rxjava3
  123. implementation libs.bundles.autodispose
  124. implementation libs.bundles.dagger
  125. kapt libs.bundles.dagger.processors
  126. implementation libs.sparkbutton
  127. implementation libs.photoview
  128. implementation libs.bundles.material.drawer
  129. implementation libs.material.typeface
  130. implementation libs.image.cropper
  131. implementation libs.bundles.filemojicompat
  132. implementation libs.bouncycastle
  133. implementation libs.unified.push
  134. testImplementation libs.androidx.test.junit
  135. testImplementation libs.robolectric
  136. testImplementation libs.bundles.mockito
  137. testImplementation libs.mockwebserver
  138. testImplementation libs.androidx.core.testing
  139. testImplementation libs.kotlinx.coroutines.test
  140. testImplementation libs.androidx.work.testing
  141. testImplementation libs.truth
  142. testImplementation libs.turbine
  143. androidTestImplementation libs.espresso.core
  144. androidTestImplementation libs.androidx.room.testing
  145. androidTestImplementation libs.androidx.test.junit
  146. }