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