build.gradle 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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.4.1'
  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. quicksyFreeCompatImplementation
  23. quicksyImplementation
  24. }
  25. ext {
  26. supportLibVersion = '28.0.0'
  27. }
  28. dependencies {
  29. playstoreImplementation('com.google.firebase:firebase-messaging:17.3.4') {
  30. exclude group: 'com.google.firebase', module: 'firebase-core'
  31. exclude group: 'com.google.firebase', module: 'firebase-analytics'
  32. exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
  33. }
  34. implementation 'org.sufficientlysecure:openpgp-api:10.0'
  35. implementation ('com.theartofdev.edmodo:android-image-cropper:2.7.+') {
  36. exclude group: 'com.android.support', module: 'appcompat-v7'
  37. exclude group: 'com.android.support', module: 'exifinterface'
  38. }
  39. implementation "com.android.support:support-v13:$supportLibVersion"
  40. implementation "com.android.support:appcompat-v7:$supportLibVersion"
  41. implementation "com.android.support:exifinterface:$supportLibVersion"
  42. implementation "com.android.support:cardview-v7:$supportLibVersion"
  43. implementation "com.android.support:support-emoji:$supportLibVersion"
  44. implementation "com.android.support:design:$supportLibVersion"
  45. compatImplementation "com.android.support:support-emoji-appcompat:$supportLibVersion"
  46. conversationsFreeCompatImplementation "com.android.support:support-emoji-bundled:$supportLibVersion"
  47. quicksyFreeCompatImplementation "com.android.support:support-emoji-bundled:$supportLibVersion"
  48. implementation 'org.bouncycastle:bcmail-jdk15on:1.58'
  49. implementation 'com.google.zxing:core:3.3.3'
  50. implementation 'de.measite.minidns:minidns-hla:0.2.4'
  51. implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
  52. implementation 'org.whispersystems:signal-protocol-java:2.6.2'
  53. implementation 'com.makeramen:roundedimageview:2.3.0'
  54. implementation "com.wefika:flowlayout:0.4.1"
  55. implementation 'net.ypresto.androidtranscoder:android-transcoder:0.3.0'
  56. implementation project(':libs:xmpp-addr')
  57. implementation 'org.osmdroid:osmdroid-android:6.0.3'
  58. implementation 'org.hsluv:hsluv:0.2'
  59. implementation 'org.conscrypt:conscrypt-android:1.3.0'
  60. implementation 'me.drakeet.support:toastcompat:1.1.0'
  61. implementation "com.leinardi.android:speed-dial:2.0.1"
  62. implementation 'com.squareup.retrofit2:retrofit:2.5.0'
  63. implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
  64. implementation 'com.google.guava:guava:27.1-android'
  65. quicksyImplementation 'io.michaelrocks:libphonenumber-android:8.10.1'
  66. }
  67. ext {
  68. travisBuild = System.getenv("TRAVIS") == "true"
  69. preDexEnabled = System.getProperty("pre-dex", "true")
  70. }
  71. android {
  72. compileSdkVersion 28
  73. defaultConfig {
  74. minSdkVersion 16
  75. targetSdkVersion 28
  76. versionCode 331
  77. versionName "1.3.00"
  78. archivesBaseName += "-$versionName"
  79. applicationId "eu.siacs.darkmessenger"
  80. resValue "string", "applicationId", applicationId
  81. resValue "string", "app_name", "DarkMessenger"
  82. buildConfigField "String", "LOGTAG", "\"darkmessenger\""
  83. }
  84. dataBinding {
  85. enabled true
  86. }
  87. dexOptions {
  88. // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
  89. preDexLibraries = preDexEnabled && !travisBuild
  90. jumboMode true
  91. }
  92. compileOptions {
  93. sourceCompatibility JavaVersion.VERSION_1_8
  94. targetCompatibility JavaVersion.VERSION_1_8
  95. }
  96. flavorDimensions("mode", "distribution", "emoji")
  97. productFlavors {
  98. quicksy {
  99. dimension "mode"
  100. applicationId = "im.quicksy.client"
  101. resValue "string", "app_name", "Quicksy"
  102. resValue "string", "applicationId", applicationId
  103. buildConfigField "String", "LOGTAG", "\"quicksy\""
  104. }
  105. conversations {
  106. dimension "mode"
  107. }
  108. playstore {
  109. dimension "distribution"
  110. versionNameSuffix "+p"
  111. }
  112. free {
  113. dimension "distribution"
  114. versionNameSuffix "+f"
  115. }
  116. system {
  117. dimension "emoji"
  118. versionNameSuffix "s"
  119. }
  120. compat {
  121. dimension "emoji"
  122. versionNameSuffix "c"
  123. }
  124. }
  125. sourceSets {
  126. quicksyFreeCompat {
  127. java {
  128. srcDirs 'src/freeCompat/java'
  129. }
  130. }
  131. quicksyPlaystoreCompat {
  132. java {
  133. srcDirs 'src/playstoreCompat/java'
  134. }
  135. res {
  136. srcDir 'src/playstoreCompat/res'
  137. srcDir 'src/quicksyPlaystore/res'
  138. }
  139. }
  140. quicksyPlaystoreSystem {
  141. res {
  142. srcDir 'src/quicksyPlaystore/res'
  143. }
  144. }
  145. conversationsFreeCompat {
  146. java {
  147. srcDirs 'src/freeCompat/java'
  148. }
  149. }
  150. conversationsPlaystoreCompat {
  151. java {
  152. srcDirs 'src/playstoreCompat/java'
  153. }
  154. res {
  155. srcDir 'src/playstoreCompat/res'
  156. srcDir 'src/conversationsPlaystore/res'
  157. }
  158. }
  159. conversationsPlaystoreSystem {
  160. res {
  161. srcDir 'src/conversationsPlaystore/res'
  162. }
  163. }
  164. }
  165. buildTypes {
  166. release {
  167. shrinkResources true
  168. minifyEnabled true
  169. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  170. versionNameSuffix "r"
  171. }
  172. debug {
  173. shrinkResources true
  174. minifyEnabled true
  175. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  176. versionNameSuffix "d"
  177. }
  178. }
  179. if (new File("signing.properties").exists()) {
  180. Properties props = new Properties()
  181. props.load(new FileInputStream(file("signing.properties")))
  182. signingConfigs {
  183. release {
  184. storeFile file(props['keystore'])
  185. storePassword props['keystore.password']
  186. keyAlias props['keystore.alias']
  187. keyPassword props['keystore.password']
  188. }
  189. }
  190. buildTypes.release.signingConfig = signingConfigs.release
  191. }
  192. lintOptions {
  193. disable 'ExtraTranslation', 'MissingTranslation', 'InvalidPackage', 'MissingQuantity', 'AppCompatResource'
  194. }
  195. subprojects {
  196. afterEvaluate {
  197. if (getPlugins().hasPlugin('android') ||
  198. getPlugins().hasPlugin('android-library')) {
  199. configure(android.lintOptions) {
  200. disable 'AndroidGradlePluginVersion', 'MissingTranslation'
  201. }
  202. }
  203. }
  204. }
  205. packagingOptions {
  206. exclude 'META-INF/BCKEY.DSA'
  207. exclude 'META-INF/BCKEY.SF'
  208. }
  209. }