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