build.gradle 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. // Top-level build file where you can add configuration options common to all
  2. // sub-projects/modules.
  3. buildscript {
  4. repositories {
  5. google()
  6. jcenter()
  7. }
  8. dependencies {
  9. classpath 'com.android.tools.build:gradle:3.6.3'
  10. }
  11. }
  12. apply plugin: 'com.android.application'
  13. repositories {
  14. google()
  15. jcenter()
  16. mavenCentral()
  17. }
  18. configurations {
  19. playstoreImplementation
  20. compatImplementation
  21. conversationsFreeCompatImplementation
  22. conversationsPlaystoreCompatImplementation
  23. conversationsPlaystoreSystemImplementation
  24. quicksyFreeCompatImplementation
  25. quicksyImplementation
  26. }
  27. ext {
  28. supportLibVersion = '28.0.0'
  29. }
  30. dependencies {
  31. playstoreImplementation('com.google.firebase:firebase-messaging:17.3.4') {
  32. exclude group: 'com.google.firebase', module: 'firebase-core'
  33. exclude group: 'com.google.firebase', module: 'firebase-analytics'
  34. exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
  35. }
  36. conversationsPlaystoreCompatImplementation("com.android.installreferrer:installreferrer:1.1")
  37. conversationsPlaystoreSystemImplementation("com.android.installreferrer:installreferrer:1.1")
  38. implementation 'org.sufficientlysecure:openpgp-api:10.0'
  39. implementation('com.theartofdev.edmodo:android-image-cropper:2.7.+') {
  40. exclude group: 'com.android.support', module: 'appcompat-v7'
  41. exclude group: 'com.android.support', module: 'exifinterface'
  42. }
  43. implementation "com.android.support:support-v13:$supportLibVersion"
  44. implementation "com.android.support:appcompat-v7:$supportLibVersion"
  45. implementation "com.android.support:exifinterface:$supportLibVersion"
  46. implementation "com.android.support:cardview-v7:$supportLibVersion"
  47. implementation "com.android.support:support-emoji:$supportLibVersion"
  48. implementation "com.android.support:design:$supportLibVersion"
  49. compatImplementation "com.android.support:support-emoji-appcompat:$supportLibVersion"
  50. conversationsFreeCompatImplementation "com.android.support:support-emoji-bundled:$supportLibVersion"
  51. quicksyFreeCompatImplementation "com.android.support:support-emoji-bundled:$supportLibVersion"
  52. implementation 'org.bouncycastle:bcmail-jdk15on:1.64'
  53. //zxing stopped supporting Java 7 so we have to stick with 3.3.3
  54. //https://github.com/zxing/zxing/issues/1170
  55. implementation 'com.google.zxing:core:3.3.3'
  56. implementation 'de.measite.minidns:minidns-hla:0.2.4'
  57. implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
  58. implementation 'org.whispersystems:signal-protocol-java:2.6.2'
  59. implementation 'com.makeramen:roundedimageview:2.3.0'
  60. implementation "com.wefika:flowlayout:0.4.1"
  61. implementation 'net.ypresto.androidtranscoder:android-transcoder:0.3.0'
  62. implementation project(':libs:xmpp-addr')
  63. implementation 'org.osmdroid:osmdroid-android:6.1.5'
  64. implementation 'org.hsluv:hsluv:0.2'
  65. implementation 'org.conscrypt:conscrypt-android:2.2.1'
  66. implementation 'me.drakeet.support:toastcompat:1.1.0'
  67. implementation "com.leinardi.android:speed-dial:2.0.1"
  68. //retrofit needs to stick with 2.6.x (https://github.com/square/retrofit/blob/master/CHANGELOG.md)
  69. implementation "com.squareup.retrofit2:retrofit:2.6.4"
  70. implementation "com.squareup.retrofit2:converter-gson:2.6.4"
  71. //okhttp needs to stick with 3.12.x
  72. implementation 'com.squareup.okhttp3:okhttp:3.12.7'
  73. implementation 'com.google.guava:guava:27.1-android'
  74. quicksyImplementation 'io.michaelrocks:libphonenumber-android:8.11.1'
  75. }
  76. ext {
  77. travisBuild = System.getenv("TRAVIS") == "true"
  78. preDexEnabled = System.getProperty("pre-dex", "true")
  79. }
  80. android {
  81. compileSdkVersion 29
  82. defaultConfig {
  83. minSdkVersion 16
  84. targetSdkVersion 28
  85. versionCode 367
  86. versionName "2.7.1"
  87. archivesBaseName += "-$versionName"
  88. applicationId "eu.siacs.conversations"
  89. resValue "string", "applicationId", applicationId
  90. resValue "string", "app_name", "Conversations"
  91. buildConfigField "String", "LOGTAG", "\"conversations\""
  92. }
  93. dataBinding {
  94. enabled true
  95. }
  96. dexOptions {
  97. // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
  98. preDexLibraries = preDexEnabled && !travisBuild
  99. jumboMode true
  100. }
  101. compileOptions {
  102. sourceCompatibility JavaVersion.VERSION_1_8
  103. targetCompatibility JavaVersion.VERSION_1_8
  104. }
  105. flavorDimensions("mode", "distribution", "emoji")
  106. productFlavors {
  107. quicksy {
  108. dimension "mode"
  109. applicationId = "im.quicksy.client"
  110. resValue "string", "app_name", "Quicksy"
  111. resValue "string", "applicationId", applicationId
  112. buildConfigField "String", "LOGTAG", "\"quicksy\""
  113. }
  114. conversations {
  115. dimension "mode"
  116. }
  117. playstore {
  118. dimension "distribution"
  119. versionNameSuffix "+p"
  120. }
  121. free {
  122. dimension "distribution"
  123. versionNameSuffix "+f"
  124. }
  125. system {
  126. dimension "emoji"
  127. versionNameSuffix "s"
  128. }
  129. compat {
  130. dimension "emoji"
  131. versionNameSuffix "c"
  132. }
  133. }
  134. sourceSets {
  135. quicksyFreeCompat {
  136. java {
  137. srcDir 'src/freeCompat/java'
  138. }
  139. }
  140. quicksyPlaystoreCompat {
  141. java {
  142. srcDir 'src/playstoreCompat/java'
  143. }
  144. res {
  145. srcDir 'src/playstoreCompat/res'
  146. srcDir 'src/quicksyPlaystore/res'
  147. }
  148. }
  149. quicksyPlaystoreSystem {
  150. res {
  151. srcDir 'src/quicksyPlaystore/res'
  152. }
  153. }
  154. conversationsFreeCompat {
  155. java {
  156. srcDir 'src/freeCompat/java'
  157. srcDir 'src/conversationsFree/java'
  158. }
  159. }
  160. conversationsFreeSystem {
  161. java {
  162. srcDir 'src/conversationsFree/java'
  163. }
  164. }
  165. conversationsPlaystoreCompat {
  166. java {
  167. srcDir 'src/playstoreCompat/java'
  168. srcDir 'src/conversationsPlaystore/java'
  169. }
  170. res {
  171. srcDir 'src/playstoreCompat/res'
  172. srcDir 'src/conversationsPlaystore/res'
  173. }
  174. }
  175. conversationsPlaystoreSystem {
  176. java {
  177. srcDir 'src/conversationsPlaystore/java'
  178. }
  179. res {
  180. srcDir 'src/conversationsPlaystore/res'
  181. }
  182. }
  183. }
  184. buildTypes {
  185. release {
  186. shrinkResources true
  187. minifyEnabled true
  188. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  189. versionNameSuffix "r"
  190. }
  191. debug {
  192. shrinkResources true
  193. minifyEnabled true
  194. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  195. versionNameSuffix "d"
  196. }
  197. }
  198. if (new File("signing.properties").exists()) {
  199. Properties props = new Properties()
  200. props.load(new FileInputStream(file("signing.properties")))
  201. signingConfigs {
  202. release {
  203. storeFile file(props['keystore'])
  204. storePassword props['keystore.password']
  205. keyAlias props['keystore.alias']
  206. keyPassword props['keystore.password']
  207. }
  208. }
  209. buildTypes.release.signingConfig = signingConfigs.release
  210. }
  211. lintOptions {
  212. disable 'ExtraTranslation', 'MissingTranslation', 'InvalidPackage', 'MissingQuantity', 'AppCompatResource'
  213. }
  214. subprojects {
  215. afterEvaluate {
  216. if (getPlugins().hasPlugin('android') ||
  217. getPlugins().hasPlugin('android-library')) {
  218. configure(android.lintOptions) {
  219. disable 'AndroidGradlePluginVersion', 'MissingTranslation'
  220. }
  221. }
  222. }
  223. }
  224. packagingOptions {
  225. exclude 'META-INF/BCKEY.DSA'
  226. exclude 'META-INF/BCKEY.SF'
  227. }
  228. }