1// Top-level build file where you can add configuration options common to all
2// sub-projects/modules.
3buildscript {
4 repositories {
5 google()
6 mavenCentral()
7 }
8 dependencies {
9 classpath 'com.android.tools.build:gradle:8.2.0-rc03'
10 }
11}
12
13plugins {
14 id 'org.ajoberstar.grgit' version '4.1.1'
15 // PLUGIN INSERT
16}
17
18apply plugin: 'com.android.application'
19
20repositories {
21 google()
22 mavenCentral()
23 maven { url='https://jitpack.io'}
24}
25
26def tags = grgit.tag.list().findAll { it.dateTime != null }.sort { it.dateTime }
27
28// ROOT INSERT
29
30configurations {
31 playstoreImplementation
32 freeImplementation
33 conversationsFreeImplementation
34 cheogramPlaystoreImplementation
35 conversationsPlaystoreImplementation
36 quicksyPlaystoreImplementation
37 quicksyPlaystoreImplementation
38 quicksyFreeImplementation
39 quicksyImplementation
40}
41
42dependencies {
43 androidTestImplementation 'tools.fastlane:screengrab:2.1.1'
44 androidTestImplementation 'junit:junit:4.13.2'
45 androidTestImplementation 'androidx.test:runner:1.3.0'
46 androidTestImplementation 'androidx.test:rules:1.3.0'
47 androidTestImplementation 'androidx.test.ext:junit:1.1.2'
48 androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
49
50 implementation "androidx.core:core:1.10.1"
51 coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
52
53 implementation 'androidx.viewpager:viewpager:1.0.0'
54
55 playstoreImplementation('com.google.firebase:firebase-messaging:23.4.0') {
56 exclude group: 'com.google.firebase', module: 'firebase-core'
57 exclude group: 'com.google.firebase', module: 'firebase-analytics'
58 exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
59 }
60 cheogramPlaystoreImplementation("com.android.installreferrer:installreferrer:2.2")
61 cheogramPlaystoreImplementation 'com.github.singpolyma:play-licensing:1c637ea03c'
62 conversationsPlaystoreImplementation("com.android.installreferrer:installreferrer:2.2")
63 quicksyPlaystoreImplementation 'com.google.android.gms:play-services-auth-api-phone:18.0.1'
64 implementation 'com.github.open-keychain.open-keychain:openpgp-api:v5.7.1'
65 implementation("com.github.CanHub:Android-Image-Cropper:2.0.0")
66 implementation 'androidx.appcompat:appcompat:1.6.1'
67 implementation 'androidx.exifinterface:exifinterface:1.3.7'
68 implementation 'androidx.cardview:cardview:1.0.0'
69 implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
70 implementation 'com.google.android.material:material:1.11.0'
71
72 implementation "androidx.emoji2:emoji2:1.4.0"
73 freeImplementation "androidx.emoji2:emoji2-bundled:1.4.0"
74
75 implementation 'org.bouncycastle:bcmail-jdk15on:1.64'
76 //zxing stopped supporting Java 7 so we have to stick with 3.3.3
77 //https://github.com/zxing/zxing/issues/1170
78 implementation 'com.google.zxing:core:3.3.3'
79 implementation 'org.minidns:minidns-hla:1.0.4'
80 implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
81 implementation 'org.whispersystems:signal-protocol-android:2.6.2'
82 implementation "com.wefika:flowlayout:0.4.1"
83 //noinspection GradleDependency
84 implementation('com.github.natario1:Transcoder:v0.9.1') {
85 exclude group: 'com.otaliastudios.opengl', module: 'egloo'
86 }
87 implementation 'com.github.natario1:Egloo:v0.4.0'
88
89 implementation 'org.jxmpp:jxmpp-jid:1.0.3'
90 implementation 'org.jxmpp:jxmpp-stringprep-libidn:1.0.3'
91 implementation 'org.osmdroid:osmdroid-android:6.1.11'
92 implementation 'org.hsluv:hsluv:0.2'
93 implementation 'org.conscrypt:conscrypt-android:2.5.2'
94 implementation 'me.drakeet.support:toastcompat:1.1.0'
95 implementation "com.leinardi.android:speed-dial:3.2.0"
96
97 implementation "com.squareup.retrofit2:retrofit:2.9.0"
98 implementation "com.squareup.retrofit2:converter-gson:2.9.0"
99 implementation "com.squareup.okhttp3:okhttp:4.12.0"
100
101 implementation 'com.google.guava:guava:32.1.3-android'
102 implementation 'io.michaelrocks:libphonenumber-android:8.13.17'
103 implementation 'io.github.nishkarsh:android-permissions:2.1.6'
104 implementation 'androidx.recyclerview:recyclerview:1.1.0'
105 implementation 'androidx.documentfile:documentfile:1.0.1'
106 implementation 'com.github.martin-stone:hsv-alpha-color-picker-android:2.4.2'
107 implementation 'com.github.ipld:java-cid:v1.3.1'
108 //implementation 'com.splitwise:tokenautocomplete:3.0.2'
109 implementation 'com.github.singpolyma:TokenAutoComplete:bfa93780e0'
110 implementation 'com.github.singpolyma:Better-Link-Movement-Method:4df081e1e4'
111 implementation 'com.github.singpolyma:android-identicons:3361281bd4'
112 implementation 'im.conversations.webrtc:webrtc-android:119.0.0'
113 implementation 'com.github.woltapp:blurhash:master'
114 implementation 'com.caverock:androidsvg-aar:1.4'
115 implementation 'org.tomlj:tomlj:1.1.0'
116 implementation 'com.tbuonomo:dotsindicator:4.2'
117 implementation 'com.github.Priyansh-Kedia:OpenGraphParser:2.5.6'
118 implementation 'me.xdrop:fuzzywuzzy:1.4.0'
119}
120
121ext {
122 preDexEnabled = System.getProperty("pre-dex", "true")
123 abiCodes = ['armeabi-v7a': 1, 'x86': 2, 'x86_64': 3, 'arm64-v8a': 4]
124}
125
126android {
127 namespace 'eu.siacs.conversations'
128 compileSdk 34
129
130 defaultConfig {
131 minSdkVersion 21
132 targetSdkVersion 34
133 versionCode 42025 + tags.size()
134 versionName grgit.describe(always: true)
135 applicationId "eu.siacs.conversations"
136 def appName = "Conversations"
137 resValue "string", "app_name", appName
138 buildConfigField "String", "APP_NAME", "\"$appName\"";
139 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
140 }
141
142 splits {
143 abi {
144 universalApk true
145 enable true
146 reset()
147 //noinspection ChromeOsAbiSupport
148 include project.ext.abiCodes.keySet() as String[]
149 }
150 }
151
152 configurations {
153 implementation.exclude group: 'org.jetbrains' , module:'annotations'
154 }
155
156 dataBinding {
157 enabled true
158 }
159
160 compileOptions {
161 coreLibraryDesugaringEnabled true
162 sourceCompatibility JavaVersion.VERSION_17
163 targetCompatibility JavaVersion.VERSION_17
164 }
165
166 flavorDimensions += "mode"
167 flavorDimensions += "distribution"
168
169 productFlavors {
170
171 quicksy {
172 dimension "mode"
173 applicationId = "im.quicksy.client"
174
175 def appName = "Quicksy"
176 resValue "string", "app_name", appName
177 buildConfigField "String", "APP_NAME", "\"$appName\""
178 }
179
180 conversations {
181 dimension "mode"
182 }
183
184 cheogram {
185 dimension "mode"
186
187 applicationId = "com.cheogram.android"
188
189 def appName = "Cheogram"
190 resValue "string", "app_name", appName
191 buildConfigField "String", "APP_NAME", "\"$appName\"";
192 }
193
194 playstore {
195 dimension "distribution"
196 versionNameSuffix "+playstore"
197 applicationIdSuffix "playstore"
198 }
199 free {
200 dimension "distribution"
201 versionNameSuffix "+free"
202 }
203 }
204
205 applicationVariants.all { variant ->
206 variant.resValue "string", "applicationId", applicationId
207 }
208
209 sourceSets {
210 quicksyFree {
211 java {
212 srcDir 'src/quicksyFree/java'
213 }
214 }
215 quicksyPlaystore {
216 java {
217 srcDir 'src/quicksyPlaystore/java'
218 }
219 res {
220 srcDir 'src/quicksyPlaystore/res'
221 }
222 }
223 conversationsFree {
224 java {
225 srcDir 'src/conversationsFree/java'
226 }
227 }
228 cheogramFree {
229 java {
230 srcDir 'src/conversationsFree/java'
231 }
232 }
233 conversationsPlaystore {
234 java {
235 srcDir 'src/conversationsPlaystore/java'
236 }
237 res {
238 srcDir 'src/conversationsPlaystore/res'
239 }
240 }
241 }
242
243 buildTypes {
244 release {
245 shrinkResources true
246 minifyEnabled true
247 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
248 ndk.debugSymbolLevel = 'full'
249 }
250 debug {
251 shrinkResources true
252 minifyEnabled true
253 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
254 }
255 }
256
257
258 if (new File("signing.properties").exists()) {
259 Properties props = new Properties()
260 props.load(new FileInputStream(file("signing.properties")))
261
262 signingConfigs {
263 release {
264 storeFile file(props['keystore'])
265 storePassword props['keystore.password']
266 keyAlias props['keystore.alias']
267 keyPassword props['keystore.password']
268 }
269 }
270 buildTypes.release.signingConfig = signingConfigs.release
271 }
272
273 lintOptions {
274 disable 'MissingTranslation', 'InvalidPackage','AppCompatResource'
275 abortOnError false
276 }
277
278 subprojects {
279
280 afterEvaluate {
281 if (getPlugins().hasPlugin('android') ||
282 getPlugins().hasPlugin('android-library')) {
283
284 configure(android.lintOptions) {
285 disable 'AndroidGradlePluginVersion', 'MissingTranslation'
286 abortOnError false
287 }
288 }
289
290 }
291 }
292 packagingOptions {
293 resources {
294 excludes += ['META-INF/BCKEY.DSA', 'META-INF/BCKEY.SF']
295 }
296 }
297 lint {
298 disable 'MissingTranslation', 'InvalidPackage', 'AppCompatResource'
299 }
300 buildFeatures {
301 buildConfig true
302 }
303
304 android.applicationVariants.configureEach { variant ->
305 variant.outputs.each { output ->
306 def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(com.android.build.OutputFile.ABI))
307 if (baseAbiVersionCode != null) {
308 output.versionCodeOverride = (100 * project.android.defaultConfig.versionCode) + baseAbiVersionCode
309 } else {
310 output.versionCodeOverride = (100 * project.android.defaultConfig.versionCode) + grgit.log(includes: ["HEAD"], excludes: [tags.last()]).size()
311 }
312 }
313
314 }
315}