build.gradle 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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.3.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. quicksyImplementation 'io.michaelrocks:libphonenumber-android:8.10.1'
  63. }
  64. ext {
  65. travisBuild = System.getenv("TRAVIS") == "true"
  66. preDexEnabled = System.getProperty("pre-dex", "true")
  67. }
  68. android {
  69. compileSdkVersion 28
  70. defaultConfig {
  71. minSdkVersion 16
  72. targetSdkVersion 28
  73. versionCode 321
  74. versionName "1.2.00"
  75. archivesBaseName += "-$versionName"
  76. applicationId "eu.siacs.darkmessenger"
  77. resValue "string", "applicationId", applicationId
  78. resValue "string", "app_name", "DarkMessenger"
  79. buildConfigField "String", "LOGTAG", "\"darkmessenger\""
  80. }
  81. dataBinding {
  82. enabled true
  83. }
  84. dexOptions {
  85. // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
  86. preDexLibraries = preDexEnabled && !travisBuild
  87. jumboMode true
  88. }
  89. compileOptions {
  90. sourceCompatibility JavaVersion.VERSION_1_8
  91. targetCompatibility JavaVersion.VERSION_1_8
  92. }
  93. flavorDimensions("mode", "distribution", "emoji")
  94. productFlavors {
  95. quicksy {
  96. dimension "mode"
  97. applicationId = "im.quicksy.client"
  98. resValue "string", "app_name", "Quicksy"
  99. resValue "string", "applicationId", applicationId
  100. buildConfigField "String", "LOGTAG", "\"quicksy\""
  101. }
  102. conversations {
  103. dimension "mode"
  104. }
  105. playstore {
  106. dimension "distribution"
  107. versionNameSuffix "+p"
  108. }
  109. free {
  110. dimension "distribution"
  111. versionNameSuffix "+f"
  112. }
  113. system {
  114. dimension "emoji"
  115. versionNameSuffix "s"
  116. }
  117. compat {
  118. dimension "emoji"
  119. versionNameSuffix "c"
  120. }
  121. }
  122. sourceSets {
  123. quicksyFreeCompat {
  124. java {
  125. srcDirs 'src/freeCompat/java'
  126. }
  127. }
  128. quicksyPlaystoreCompat {
  129. java {
  130. srcDirs 'src/playstoreCompat/java'
  131. }
  132. res {
  133. srcDir 'src/playstoreCompat/res'
  134. srcDir 'src/quicksyPlaystore/res'
  135. }
  136. }
  137. quicksyPlaystoreSystem {
  138. res {
  139. srcDir 'src/quicksyPlaystore/res'
  140. }
  141. }
  142. conversationsFreeCompat {
  143. java {
  144. srcDirs 'src/freeCompat/java'
  145. }
  146. }
  147. conversationsPlaystoreCompat {
  148. java {
  149. srcDirs 'src/playstoreCompat/java'
  150. }
  151. res {
  152. srcDir 'src/playstoreCompat/res'
  153. srcDir 'src/conversationsPlaystore/res'
  154. }
  155. }
  156. conversationsPlaystoreSystem {
  157. res {
  158. srcDir 'src/conversationsPlaystore/res'
  159. }
  160. }
  161. }
  162. buildTypes {
  163. release {
  164. shrinkResources true
  165. minifyEnabled true
  166. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  167. versionNameSuffix "r"
  168. }
  169. debug {
  170. shrinkResources true
  171. minifyEnabled true
  172. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  173. versionNameSuffix "d"
  174. }
  175. }
  176. if (new File("signing.properties").exists()) {
  177. Properties props = new Properties()
  178. props.load(new FileInputStream(file("signing.properties")))
  179. signingConfigs {
  180. release {
  181. storeFile file(props['keystore'])
  182. storePassword props['keystore.password']
  183. keyAlias props['keystore.alias']
  184. keyPassword props['keystore.password']
  185. }
  186. }
  187. buildTypes.release.signingConfig = signingConfigs.release
  188. }
  189. lintOptions {
  190. disable 'ExtraTranslation', 'MissingTranslation', 'InvalidPackage', 'MissingQuantity', 'AppCompatResource'
  191. }
  192. subprojects {
  193. afterEvaluate {
  194. if (getPlugins().hasPlugin('android') ||
  195. getPlugins().hasPlugin('android-library')) {
  196. configure(android.lintOptions) {
  197. disable 'AndroidGradlePluginVersion', 'MissingTranslation'
  198. }
  199. }
  200. }
  201. }
  202. packagingOptions {
  203. exclude 'META-INF/BCKEY.DSA'
  204. exclude 'META-INF/BCKEY.SF'
  205. }
  206. }